all MDL-20821 Removed ereg related deprecated functions
This commit is contained in:
@@ -174,7 +174,7 @@ function validateUrlSyntax( $urladdr, $options="" ){
|
||||
// $options = strtolower($options);
|
||||
|
||||
// Check Options Parameter
|
||||
if (!ereg( '^([sHSEFuPaIpfqr][+?-])*$', $options ))
|
||||
if (!preg_match( '/^([sHSEFuPaIpfqr][+?-])*$/', $options ))
|
||||
{
|
||||
trigger_error("Options attribute malformed", E_USER_ERROR);
|
||||
}
|
||||
@@ -305,17 +305,18 @@ function validateUrlSyntax( $urladdr, $options="" ){
|
||||
$querystring = '(\?(' . $reserved . '|' . $unreserved . '|' . $escaped . ')*)' . $aOptions['q'];
|
||||
|
||||
// Fragment Section - Accepts anchors such as #top
|
||||
$fragment = '(#(' . $reserved . '|' . $unreserved . '|' . $escaped . ')*)' . $aOptions['r'];
|
||||
$fragment = '(\#(' . $reserved . '|' . $unreserved . '|' . $escaped . ')*)' . $aOptions['r'];
|
||||
|
||||
|
||||
// Building Regular Expression
|
||||
$regexp = '^' . $scheme . $userinfo . $address . $port_number . $path . $querystring . $fragment . '$';
|
||||
$regexp = '#^' . $scheme . $userinfo . $address . $port_number . $path . $querystring . $fragment . '$' . '#i';
|
||||
//die($regexp);
|
||||
|
||||
// DEBUGGING - Uncomment Line Below To Display The Regular Expression Built
|
||||
// echo '<pre>' . htmlentities(wordwrap($regexp,70,"\n",1)) . '</pre>';
|
||||
|
||||
// Running the regular expression
|
||||
if (eregi( $regexp, $urladdr ))
|
||||
if (preg_match( $regexp, $urladdr ))
|
||||
{
|
||||
return true; // The domain passed
|
||||
}
|
||||
@@ -377,7 +378,7 @@ License:
|
||||
function validateEmailSyntax( $emailaddr, $options="" ){
|
||||
|
||||
// Check Options Parameter
|
||||
if (!ereg( '^([sHSEFuPaIpfqr][+?-])*$', $options ))
|
||||
if (!preg_match( '/^([sHSEFuPaIpfqr][+?-])*$/', $options ))
|
||||
{
|
||||
trigger_error("Options attribute malformed", E_USER_ERROR);
|
||||
}
|
||||
@@ -483,7 +484,7 @@ License:
|
||||
function validateFtpSyntax( $ftpaddr, $options="" ){
|
||||
|
||||
// Check Options Parameter
|
||||
if (!ereg( '^([sHSEFuPaIpfqr][+?-])*$', $options ))
|
||||
if (!preg_match( '/^([sHSEFuPaIpfqr][+?-])*$/', $options ))
|
||||
{
|
||||
trigger_error("Options attribute malformed", E_USER_ERROR);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user