Welcome to Vtiger Community. To gain access for account, please contact [ info @ vtiger.com ]

Commit 84df3ca6e0a8d6f7d6ac4a054770ebc61ff74e3f

Authored by Prasad
1 parent c046958a

Added ereg* backward compatability for php7.

Showing 1 changed file with 10 additions and 7 deletions
include/utils/utils.php
... ... @@ -2321,13 +2321,16 @@ function php7_compat_split($delim, $str, $ignore_case=false) {
2321 2321 return $splits;
2322 2322 }
2323 2323  
2324   -if (!function_exists('split')) {
2325   - function split($delim, $str) { return php7_compat_split($delim, $str); }
2326   -}
2327   -if (!function_exists('spliti')) {
2328   - function spliti($delim, $str) {
2329   - return php7_compat_split($delim, $str, true);
2330   - }
  2324 +if (!function_exists('split')) { function split($delim, $str) {return php7_compat_split($delim, $str); } }
  2325 +if (!function_exists('spliti')) { function spliti($delim, $str) {return php7_compat_split($delim, $str, true);}}
  2326 +
  2327 +function php7_compat_ereg($pattern, $str, $ignore_case=false) {
  2328 + $regex = '/'. preg_replace('/\//', '\\/', $pattern) .'/' . ($ignore_case ? 'i': '');
  2329 + return preg_match($regex, $str);
2331 2330 }
2332 2331  
  2332 +if (!function_exists('ereg')) { function ereg($pattern, $str) { return php7_compat_ereg($pattern, $str); } }
  2333 +if (!function_exists('eregi')) { function ereg($pattern, $str) { return php7_compat_ereg($pattern, $str, true); } }
2
  2334 +
  2335 +
2333 2336 ?>
2334 2337 \ No newline at end of file
... ...