Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
vtigercrm
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Welcome to Vtiger Community. To gain access for account, please contact [ community @ vtiger.com ]
Show more breadcrumbs
Madhuk
vtigercrm
Commits
c89f8ac9
Commit
c89f8ac9
authored
5 years ago
by
Uma
Browse files
Options
Downloads
Patches
Plain Diff
Fixes
#1178
split api is replaced with preg_split
parent
bec7ba8c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/utils/VtlibUtils.php
+7
-0
7 additions, 0 deletions
include/utils/VtlibUtils.php
include/utils/utils.php
+0
-27
0 additions, 27 deletions
include/utils/utils.php
with
7 additions
and
27 deletions
include/utils/VtlibUtils.php
+
7
−
0
View file @
c89f8ac9
...
...
@@ -839,4 +839,11 @@ if (!function_exists('split')) {
}
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
This diff is collapsed.
Click to expand it.
include/utils/utils.php
+
0
−
27
View file @
c89f8ac9
...
...
@@ -2322,33 +2322,6 @@ function lower_array(&$string){
$string
=
strtolower
(
trim
(
$string
));
}
/* PHP 7 support */
function
php7_compat_split
(
$delim
,
$str
,
$ignore_case
=
false
)
{
$splits
=
array
();
while
(
$str
)
{
$pos
=
$ignore_case
?
stripos
(
$str
,
$delim
)
:
strpos
(
$str
,
$delim
);
if
(
$pos
!==
false
)
{
$splits
[]
=
substr
(
$str
,
0
,
$pos
);
$str
=
substr
(
$str
,
$pos
+
strlen
(
$delim
));
}
else
{
$splits
[]
=
$str
;
$str
=
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
);}}
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
);
}
}
if
(
!
function_exists
(
'get_magic_quotes_runtime'
))
{
function
get_magic_quotes_runtime
()
{
return
false
;
}
}
if
(
!
function_exists
(
'set_magic_quotes_runtime'
))
{
function
set_magic_quotes_runtime
(
$flag
)
{}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment