File: 06_fix-php-web-for-php7.diff

package info (click to toggle)
mlmmj 1.5.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,444 kB
  • sloc: ansic: 13,036; sh: 5,950; php: 1,336; perl: 904; makefile: 99
file content (23 lines) | stat: -rw-r--r-- 927 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Description: Update for PHP 5 -> PHP 7 transition
 ereg() and eregi() were deprecated with PHP 5.3.0 and removed in PHP 7.0.0
   https://secure.php.net/manual/en/function.ereg.php
   https://secure.php.net/manual/en/function.eregi.php
 Also remove min 2, max 4 character TLD portion of regex, as there are
 top-level domains > 4 chars now.
 Thanks to Ron Guerin <ron@vnetworx.net> for his help with the PHP regexes.
Author: Christopher Knadle <Chris.Knadle@coredump.us>
Bug-Debian: https://bugs.debian.org/821532
Bug-Debian: https://bugs.debian.org/821533
Last-Updated: 2016-05-22

--- a/contrib/web/php-user/mlmmj.php
+++ b/contrib/web/php-user/mlmmj.php
@@ -37,7 +37,7 @@
 
     function is_email($string="") 
 	{
-	    if (eregi("^[a-z0-9\._-]+".chr(64)."+[a-z0-9\._-]+\.+[a-z]{2,4}$", $string)) 
+	    if (preg_match(chr(7)."^[a-z0-9\._-]+@+[a-z0-9\._-]+\.+[a-z]+$".chr(7).'i', $string)) 
 	    { 
 		return TRUE; 
 	    }