From cbfe7a3e9e4508386d8e7e4004ac55ec55528335 Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Tue, 21 Oct 2014 07:21:13 -0500 Subject: [PATCH 1/3] Update version What is this file used for? --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index c61e20fa7..cfc730712 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.27.99.0 +1.28.0 From e23c756ca4d4da66a89f8edb737f3050e914da64 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 21 Oct 2014 15:17:34 -0400 Subject: [PATCH 2/3] Revert "replace uri_encode with uri_escape" This reverts commit ce5396f4eac523f6c047bc47a1109aa869c26f34. --- distros/ubuntu1204/control | 2 +- scripts/ZoneMinder/lib/ZoneMinder/Control/M8640.pm | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/distros/ubuntu1204/control b/distros/ubuntu1204/control index 8feb9bbb8..7ad729070 100644 --- a/distros/ubuntu1204/control +++ b/distros/ubuntu1204/control @@ -7,7 +7,7 @@ Standards-Version: 3.9.2 Package: zoneminder Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, apache2, libapache2-mod-php5 | libapache2-mod-fcgid, php5, php5-mysql|php5-mysqlnd, libphp-serialization-perl, libdate-manip-perl, libmime-lite-perl, libmime-tools-perl, mariadb-client|mysql-client, libwww-perl, libarchive-tar-perl, libarchive-zip-perl, libdevice-serialport-perl, libpcre3, ffmpeg | libav-tools, rsyslog | system-log-daemon, libmodule-load-perl, libsys-mmap-perl, libjson-any-perl, netpbm, libavdevice53, libjpeg8, zip, libnet-sftp-foreign-perl, libio-pty-perl, libexpect-perl, libvlccore5 | libvlccore7 | libvlccore8, libvlc5, libcurl4-gnutls-dev | libcurl4-nss-dev | libcurl4-openssl-dev, libpolkit-gobject-1-0, liburi-escape-perl +Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, apache2, libapache2-mod-php5 | libapache2-mod-fcgid, php5, php5-mysql|php5-mysqlnd, libphp-serialization-perl, libdate-manip-perl, libmime-lite-perl, libmime-tools-perl, mariadb-client|mysql-client, libwww-perl, libarchive-tar-perl, libarchive-zip-perl, libdevice-serialport-perl, libpcre3, ffmpeg | libav-tools, rsyslog | system-log-daemon, libmodule-load-perl, libsys-mmap-perl, libjson-any-perl, netpbm, libavdevice53, libjpeg8, zip, libnet-sftp-foreign-perl, libio-pty-perl, libexpect-perl, libvlccore5 | libvlccore7 | libvlccore8, libvlc5, libcurl4-gnutls-dev | libcurl4-nss-dev | libcurl4-openssl-dev, libpolkit-gobject-1-0, liburi-encode-perl Recommends: mysql-server|mariadb-server Description: A video camera security and surveillance solution ZoneMinder is intended for use in single or multi-camera video security diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/M8640.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/M8640.pm index 1c5f61f48..584e04dd1 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Control/M8640.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/M8640.pm @@ -48,7 +48,7 @@ use ZoneMinder::Logger qw(:all); use ZoneMinder::Config qw(:all); use Time::HiRes qw( usleep ); -use URI::Escape qw(uri_escape); +use URI::Encode qw(); sub new { my $class = shift; @@ -115,7 +115,8 @@ sub sendCmd { $url = 'http://'.$self->{Monitor}->{ControlAddress}.'/cgi-bin/setGPIO.cgi?preventCache='.time; } # en dif Error("Url: $url $cmd"); - my $encoded = uri_escape( $cmd ); + my $uri = URI::Encode->new( { encode_reserved => 0 } ); + my $encoded = $uri->encode( $cmd ); my $res = $self->{ua}->post( $url, Content=>"data=$encoded" ); if ( $res->is_success ) { From 85529efffcf79181c15bcd8a25954edd4955328c Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 22 Oct 2014 10:31:23 -0400 Subject: [PATCH 3/3] check for existence of the columns beefore trying to add them --- db/zm_update-1.26.0.sql | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/db/zm_update-1.26.0.sql b/db/zm_update-1.26.0.sql index 28f8685ef..9986c029b 100644 --- a/db/zm_update-1.26.0.sql +++ b/db/zm_update-1.26.0.sql @@ -1,3 +1,27 @@ -ALTER TABLE `Monitors` ADD `Colours` TINYINT UNSIGNED NOT NULL DEFAULT '1' AFTER `Height`; -ALTER TABLE `Monitors` ADD `Deinterlacing` INT UNSIGNED NOT NULL DEFAULT '0' AFTER `Orientation`; +SET @s = (SELECT IF( + (SELECT COUNT(*) + FROM INFORMATION_SCHEMA.COLUMNS + WHERE table_name = 'Monitors' + AND table_schema = DATABASE() + AND column_name = 'Colours' + ) > 0, +"SELECT 'Column Colours exists in Monitors'", +"ALTER TABLE `Monitors` ADD `Colours` TINYINT UNSIGNED NOT NULL DEFAULT '1' AFTER `Height`" +)); +PREPARE stmt FROM @s; +EXECUTE stmt; + +SET @s = (SELECT IF( + (SELECT COUNT(*) + FROM INFORMATION_SCHEMA.COLUMNS + WHERE table_name = 'Monitors' + AND table_schema = DATABASE() + AND column_name = 'Deinterlacing' + ) > 0, +"SELECT 'Column Deinterlacing exists in Monitors'", +"ALTER TABLE `Monitors` ADD `Deinterlacing` INT UNSIGNED NOT NULL DEFAULT '0' AFTER `Orientation`" +)); + +PREPARE stmt FROM @s; +EXECUTE stmt;