Replace some ereg function (depreciated) by preg_match.

git-svn-id: http://piwigo.org/svn/branches/2.0@4035 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
patdenice 2009-10-14 15:06:36 +00:00
parent 916fa5ea70
commit 246634cb72
2 changed files with 4 additions and 4 deletions

View file

@ -231,11 +231,11 @@ if (isset($_POST['submit']))
$infos = array();
// checking criteria
if (!ereg('^[0-9]{2,3}$', $_POST['width']) or $_POST['width'] < 10)
if (!preg_match('/^[0-9]{2,3}$/', $_POST['width']) or $_POST['width'] < 10)
{
array_push($page['errors'], l10n('tn_err_width').' 10');
}
if (!ereg('^[0-9]{2,3}$', $_POST['height']) or $_POST['height'] < 10)
if (!preg_match('/^[0-9]{2,3}$/', $_POST['height']) or $_POST['height'] < 10)
{
array_push($page['errors'], l10n('tn_err_height').' 10');
}

View file

@ -75,11 +75,11 @@ function register_user($login, $password, $mail_address,
{
array_push($errors, l10n('reg_err_login1'));
}
if (ereg("^.* $", $login))
if (preg_match("/^.* $/", $login))
{
array_push($errors, l10n('reg_err_login2'));
}
if (ereg("^ .*$", $login))
if (preg_match("/^ .*$/", $login))
{
array_push($errors, l10n('reg_err_login3'));
}