Package: phamm Version: 0.6.2-2 Followup-For: Bug #821544 User: ubuntu-de...@lists.ubuntu.com Usertags: origin-ubuntu yakkety ubuntu-patch
Dear Maintainer, Further changes are needed to phamm to be PHP7 compliant. In Ubuntu, the attached patch was applied to achieve the following: * Update to PHP7.0 dependencies (LP #1562950). - Fix Apache configuration to use mod_php7.c, not mod_php.c (Ubuntu issue). * debian/patches/php7_has_removed_ereg.patch: PHP7.0 has removed ereg as an API. Closes LP: #1570968. Thanks for considering the patch. *** /tmp/tmp6G_YmL/phamm_0.6.2-2ubuntu1.debdiff diff -Nru phamm-0.6.2/debian/conf/phamm.conf phamm-0.6.2/debian/conf/phamm.conf --- phamm-0.6.2/debian/conf/phamm.conf 2014-07-14 22:38:41.000000000 -0700 +++ phamm-0.6.2/debian/conf/phamm.conf 2016-06-23 16:03:01.000000000 -0700 @@ -23,7 +23,7 @@ <IfModule mod_mime.c> - <IfModule mod_php5.c> + <IfModule mod_php7.c> AddType application/x-httpd-php .php php_flag magic_quotes_gpc Off @@ -32,12 +32,12 @@ php_value include_path . </IfModule> - <IfModule !mod_php5.c> + <IfModule !mod_php7.c> <IfModule mod_actions.c> <IfModule mod_cgi.c> AddType application/x-httpd-php .php - Action application/x-httpd-php /cgi-bin/php5 + Action application/x-httpd-php /cgi-bin/php </IfModule> </IfModule> </IfModule> diff -Nru phamm-0.6.2/debian/patches/php7_has_removed_ereg.patch phamm-0.6.2/debian/patches/php7_has_removed_ereg.patch --- phamm-0.6.2/debian/patches/php7_has_removed_ereg.patch 1969-12-31 16:00:00.000000000 -0800 +++ phamm-0.6.2/debian/patches/php7_has_removed_ereg.patch 2016-06-23 16:03:08.000000000 -0700 @@ -0,0 +1,62 @@ +Description: PHP7.0 has removed ereg as an API. +Author: Nishanth Aravamudan <nish.aravamu...@canonical.com> +Bug-Ubuntu: https://launchpad.net/bugs/1570968 + +--- phamm-0.6.2.orig/controllers/helpers.php ++++ phamm-0.6.2/controllers/helpers.php +@@ -259,7 +259,7 @@ function check_syntax ($type,$arg,$lengt + // IP Address + if ($type == 'ip') + { +- if (!ereg ("^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$", $arg)) ++ if (!preg_match ("/^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/", $arg)) + { + return FALSE; + } +@@ -282,7 +282,7 @@ function check_syntax ($type,$arg,$lengt + // DOMAIN + elseif ($type == 'domain') + { +- if (!eregi("^([0-9a-z][0-9a-z-]+\.)+[a-z]{2,7}$", $arg)) ++ if (!preg_match ("/^([0-9a-z][0-9a-z-]+\.)+[a-z]{2,7}$/i", $arg)) + { + return FALSE; + } +@@ -296,7 +296,7 @@ function check_syntax ($type,$arg,$lengt + // ALIAS and ACCOUNT + elseif ($type == 'account') + { +- if (!eregi("^[\._a-z0-9-]+$", $arg)) ++ if (!preg_match ("/^[\._a-z0-9-]+$/i", $arg)) + { + return FALSE; + } +@@ -310,7 +310,7 @@ function check_syntax ($type,$arg,$lengt + // Password + elseif ($type == 'password') + { +- if (!eregi("^[\._a-z0-9-]+$", $arg)) ++ if (!preg_match ("/^[\._a-z0-9-]+$/i", $arg)) + return false; + + return true; +@@ -319,7 +319,7 @@ function check_syntax ($type,$arg,$lengt + // Email + elseif ($type == 'email') + { +- if (!eregi("^[_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,4}$", $arg)) ++ if (!preg_match ("/^[_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,4}$/i", $arg)) + return false; + + return true; +--- phamm-0.6.2.orig/views/helpers.php ++++ phamm-0.6.2/views/helpers.php +@@ -1386,7 +1386,7 @@ function refresh ($url, $force_meta = fa + $PROTOCOL = 'http'; + + // HTTP/1.1 requires an absolute URI +- $uri = ereg ( '^http', $url ) ? $url : "$PROTOCOL://". ++ $uri = preg_match ( '/^http/', $url ) ? $url : "$PROTOCOL://". + $_SERVER['HTTP_HOST']; + + // Server Root Check diff -Nru phamm-0.6.2/debian/patches/series phamm-0.6.2/debian/patches/series --- phamm-0.6.2/debian/patches/series 1969-12-31 16:00:00.000000000 -0800 +++ phamm-0.6.2/debian/patches/series 2016-06-23 16:03:08.000000000 -0700 @@ -0,0 +1 @@ +php7_has_removed_ereg.patch -- System Information: Debian Release: stretch/sid APT prefers xenial-updates APT policy: (500, 'xenial-updates'), (500, 'xenial-security'), (500, 'xenial'), (100, 'xenial-backports') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 4.4.0-24-generic (SMP w/4 CPU cores) Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) -- Nishanth Aravamudan Ubuntu Server Canonical Ltd