Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
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
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
ced02481
Commit
ced02481
authored
15 years ago
by
Regis Houssin
Browse files
Options
Downloads
Patches
Plain Diff
Fix: functions "ereg", "ereg_replace", "eregi", "eregi_replace" is deprecated since php 5.3.0
parent
81464c0c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
htdocs/lib/functions2.lib.php
+11
-11
11 additions, 11 deletions
htdocs/lib/functions2.lib.php
with
11 additions
and
11 deletions
htdocs/lib/functions2.lib.php
+
11
−
11
View file @
ced02481
...
...
@@ -240,7 +240,7 @@ function isValidUrl($url,$http=0,$pass=0,$port=0,$path=0,$query=0,$anchor=0)
$urlregex
=
''
;
// SCHEME
if
(
$http
)
$urlregex
.
=
"^(http:\/\/|https:\/\/)"
;
if
(
$http
)
$urlregex
.
=
"
/
^(http:\/\/|https:\/\/)"
;
// USER AND PASS
if
(
$pass
)
$urlregex
.
=
"([a-z0-9+!*(),;?&=
\$
_.-]+(\:[a-z0-9+!*(),;?&=
\$
_.-]+)?@)"
;
...
...
@@ -258,10 +258,10 @@ function isValidUrl($url,$http=0,$pass=0,$port=0,$path=0,$query=0,$anchor=0)
// GET Query
if
(
$query
)
$urlregex
.
=
"(\?[a-z+&
\$
_.-][a-z0-9;:@/&%=+
\$
_.-]*)"
;
// ANCHOR
if
(
$anchor
)
$urlregex
.
=
"(#[a-z_.-][a-z0-9+
\$
_.-]*)
\
$
"
;
if
(
$anchor
)
$urlregex
.
=
"(#[a-z_.-][a-z0-9+
\$
_.-]*)$
/i
"
;
// check
if
(
e
reg
i
(
$urlregex
,
$url
))
if
(
p
reg
_match
(
$urlregex
,
$url
))
{
$ValidUrl
=
1
;
}
...
...
@@ -364,7 +364,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$valueforccc='',$date=
// but we should use local year and month of user
// Extract value for mask counter, mask raz and mask offset
if
(
!
e
reg
i
(
'\{(0+)([@\+][0-9]+)?([@\+][0-9]+)?\}'
,
$mask
,
$reg
))
return
'ErrorBadMask'
;
if
(
!
p
reg
_match
(
'
/
\{(0+)([@\+][0-9]+)?([@\+][0-9]+)?\}
/i
'
,
$mask
,
$reg
))
return
'ErrorBadMask'
;
$masktri
=
$reg
[
1
]
.
$reg
[
2
]
.
$reg
[
3
];
$maskcounter
=
$reg
[
1
];
$maskraz
=-
1
;
...
...
@@ -372,7 +372,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$valueforccc='',$date=
if
(
strlen
(
$maskcounter
)
<
3
)
return
'CounterMustHaveMoreThan3Digits'
;
// Extract value for third party mask counter
if
(
e
reg
i
(
'\{(c+)(0*)\}'
,
$mask
,
$regClientRef
))
if
(
p
reg
_match
(
'
/
\{(c+)(0*)\}
/i
'
,
$mask
,
$regClientRef
))
{
$maskrefclient
=
$regClientRef
[
1
]
.
$regClientRef
[
2
];
$maskrefclient_maskclientcode
=
$regClientRef
[
1
];
...
...
@@ -476,7 +476,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$valueforccc='',$date=
$counter
=
$obj
->
val
;
}
else
dol_print_error
(
$db
);
if
(
empty
(
$counter
)
||
e
reg
i
(
'[^0-9]'
,
$counter
))
$counter
=
$maskoffset
;
if
(
empty
(
$counter
)
||
p
reg
_match
(
'
/
[^0-9]
/i
'
,
$counter
))
$counter
=
$maskoffset
;
$counter
++
;
if
(
$maskrefclient_maskcounter
)
...
...
@@ -519,7 +519,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$valueforccc='',$date=
$maskrefclient_counter
=
$maskrefclient_obj
->
val
;
}
else
dol_print_error
(
$db
);
if
(
empty
(
$maskrefclient_counter
)
||
e
reg
i
(
'[^0-9]'
,
$maskrefclient_counter
))
$maskrefclient_counter
=
$maskrefclient_maskoffset
;
if
(
empty
(
$maskrefclient_counter
)
||
p
reg
_match
(
'
/
[^0-9]
/i
'
,
$maskrefclient_counter
))
$maskrefclient_counter
=
$maskrefclient_maskoffset
;
$maskrefclient_counter
++
;
}
...
...
@@ -571,7 +571,7 @@ function check_value($mask,$value)
$result
=
0
;
// Extract value for mask counter, mask raz and mask offset
if
(
!
e
reg
i
(
'\{(0+)([@\+][0-9]+)?([@\+][0-9]+)?\}'
,
$mask
,
$reg
))
return
'ErrorBadMask'
;
if
(
!
p
reg
_match
(
'
/
\{(0+)([@\+][0-9]+)?([@\+][0-9]+)?\}
/i
'
,
$mask
,
$reg
))
return
'ErrorBadMask'
;
$masktri
=
$reg
[
1
]
.
$reg
[
2
]
.
$reg
[
3
];
$maskcounter
=
$reg
[
1
];
$maskraz
=-
1
;
...
...
@@ -579,7 +579,7 @@ function check_value($mask,$value)
if
(
strlen
(
$maskcounter
)
<
3
)
return
'CounterMustHaveMoreThan3Digits'
;
// Extract value for third party mask counter
if
(
e
reg
i
(
'\{(c+)(0*)\}'
,
$mask
,
$regClientRef
))
if
(
p
reg
_match
(
'
/
\{(c+)(0*)\}
/i
'
,
$mask
,
$regClientRef
))
{
$maskrefclient
=
$regClientRef
[
1
]
.
$regClientRef
[
2
];
$maskrefclient_maskclientcode
=
$regClientRef
[
1
];
...
...
@@ -692,7 +692,7 @@ function hexbin($hexa)
function
image_format_supported
(
$file
)
{
// Case filename is not a format image
if
(
!
e
reg
i
(
'(\.gif|\.jpg|\.jpeg|\.png|\.bmp)$'
,
$file
,
$reg
))
return
-
1
;
if
(
!
p
reg
_match
(
'
/
(\.gif|\.jpg|\.jpeg|\.png|\.bmp)$
/i
'
,
$file
,
$reg
))
return
-
1
;
// Case filename is a format image but not supported by this PHP
$imgfonction
=
''
;
...
...
@@ -926,7 +926,7 @@ function version_os()
phpinfo
();
$chaine
=
ob_get_contents
();
ob_end_clean
();
e
reg
i
(
'System </td><td class="v">([^<]*)</td>'
,
$chaine
,
$reg
);
p
reg
_match
(
'
/
System </td><td class="v">([^<]*)</td>
/i
'
,
$chaine
,
$reg
);
$osversion
=
$reg
[
1
];
return
$osversion
;
}
...
...
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