MDL-20821 reverting untested ereg cleanup, not acceptable for stable, sorry

This commit is contained in:
Petr Skoda
2009-11-19 10:29:06 +00:00
parent 58693ff7a6
commit c2d4c1661a
2 changed files with 35 additions and 36 deletions
+6 -7
View File
@@ -174,7 +174,7 @@ function validateUrlSyntax( $urladdr, $options="" ){
// $options = strtolower($options);
// Check Options Parameter
if (!preg_match( '/^([sHSEFuPaIpfqr][+?-])*$/', $options ))
if (!ereg( '^([sHSEFuPaIpfqr][+?-])*$', $options ))
{
trigger_error("Options attribute malformed", E_USER_ERROR);
}
@@ -305,18 +305,17 @@ 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 . '$' . '#i';
//die($regexp);
$regexp = '^' . $scheme . $userinfo . $address . $port_number . $path . $querystring . $fragment . '$';
// DEBUGGING - Uncomment Line Below To Display The Regular Expression Built
// echo '<pre>' . htmlentities(wordwrap($regexp,70,"\n",1)) . '</pre>';
// Running the regular expression
if (preg_match( $regexp, $urladdr ))
if (eregi( $regexp, $urladdr ))
{
return true; // The domain passed
}
@@ -378,7 +377,7 @@ License:
function validateEmailSyntax( $emailaddr, $options="" ){
// Check Options Parameter
if (!preg_match( '/^([sHSEFuPaIpfqr][+?-])*$/', $options ))
if (!ereg( '^([sHSEFuPaIpfqr][+?-])*$', $options ))
{
trigger_error("Options attribute malformed", E_USER_ERROR);
}
@@ -484,7 +483,7 @@ License:
function validateFtpSyntax( $ftpaddr, $options="" ){
// Check Options Parameter
if (!preg_match( '/^([sHSEFuPaIpfqr][+?-])*$/', $options ))
if (!ereg( '^([sHSEFuPaIpfqr][+?-])*$', $options ))
{
trigger_error("Options attribute malformed", E_USER_ERROR);
}