From 84df3ca6e0a8d6f7d6ac4a054770ebc61ff74e3f Mon Sep 17 00:00:00 2001 From: prasad <prasad@vtiger.com> Date: Thu, 14 Jul 2016 00:46:50 +0530 Subject: [PATCH] Added ereg* backward compatability for php7. --- include/utils/utils.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/include/utils/utils.php b/include/utils/utils.php index cae8e2a74..4539265a6 100755 --- a/include/utils/utils.php +++ b/include/utils/utils.php @@ -2321,13 +2321,16 @@ function php7_compat_split($delim, $str, $ignore_case=false) { return $splits; } -if (!function_exists('split')) { - function split($delim, $str) { return php7_compat_split($delim, $str); } -} -if (!function_exists('spliti')) { - function spliti($delim, $str) { - return php7_compat_split($delim, $str, true); - } +if (!function_exists('split')) { function split($delim, $str) {return php7_compat_split($delim, $str); } } +if (!function_exists('spliti')) { function spliti($delim, $str) {return php7_compat_split($delim, $str, true);}} + +function php7_compat_ereg($pattern, $str, $ignore_case=false) { + $regex = '/'. preg_replace('/\//', '\\/', $pattern) .'/' . ($ignore_case ? 'i': ''); + return preg_match($regex, $str); } +if (!function_exists('ereg')) { function ereg($pattern, $str) { return php7_compat_ereg($pattern, $str); } } +if (!function_exists('eregi')) { function ereg($pattern, $str) { return php7_compat_ereg($pattern, $str, true); } } + + ?> \ No newline at end of file -- GitLab