Skip to content
Snippets Groups Projects

Fixes #1178 ::Uma::split api is been replaced with preg_split

Merged Uma requested to merge uma.s/vtigercrm:replace_split_with_preg_split into master
+ 27
32
Compare changes
  • Side-by-side
  • Inline
Files
@@ -827,4 +827,23 @@ function vtlib_addSettingsLink($linkName, $linkURL, $blockName = false) {
return $success;
}
/**
* PHP7 support for split function
* split : Case sensitive.
*/
if (!function_exists('split')) {
function split($pattern, $string, $limit = null) {
$regex = '/' . preg_replace('/\//', '\\/', $pattern) . '/';
return preg_split($regex, $string, $limit);
}
}
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 eregi($pattern, $str) { return php7_compat_ereg($pattern, $str, true); } }
?>
\ No newline at end of file
Loading