Changeset 3747


Ignore:
Timestamp:
Aug 17, 2009, 6:21:09 PM (15 years ago)
Author:
Eric
Message:

PHP 5.3 compatibility - Deprecated functions were replace as follows :
ereg() -> preg_match()
ereg_replace() -> preg_replace()
eregi() -> preg_match() with the 'i' modifier
eregi_replace() -> preg_replace() with the 'i' modifier
set_magic_quotes_runtime() -> No more usefull. Fixed it by adding "@" prefix.

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/thumbnail.php

    r3720 r3747  
    232232 
    233233  // checking criteria
    234   if (!ereg('^[0-9]{2,3}$', $_POST['width']) or $_POST['width'] < 10)
     234  if (!preg_match('/^[0-9]{2,3}$/', $_POST['width']) or $_POST['width'] < 10)
    235235  {
    236236    array_push($page['errors'], l10n('tn_err_width').' 10');
    237237  }
    238   if (!ereg('^[0-9]{2,3}$', $_POST['height']) or $_POST['height'] < 10)
     238  if (!preg_match('/^[0-9]{2,3}$/', $_POST['height']) or $_POST['height'] < 10)
    239239  {
    240240    array_push($page['errors'], l10n('tn_err_height').' 10');
  • trunk/include/common.inc.php

    r3282 r3747  
    2929$t2 = $t1[1].'.'.$t2[1];
    3030
    31 set_magic_quotes_runtime(0); // Disable magic_quotes_runtime
     31@set_magic_quotes_runtime(0); // Disable magic_quotes_runtime
    3232
    3333//
  • trunk/include/functions_user.inc.php

    r3642 r3747  
    7676    array_push($errors, l10n('reg_err_login1'));
    7777  }
    78   if (ereg("^.* $", $login))
     78  if (preg_match('/^.* $/', $login))
    7979  {
    8080    array_push($errors, l10n('reg_err_login2'));
    8181  }
    82   if (ereg("^ .*$", $login))
     82  if (preg_match('/^ .*$/', $login))
    8383  {
    8484    array_push($errors, l10n('reg_err_login3'));
  • trunk/install.php

    r3715 r3747  
    7373}
    7474
    75 set_magic_quotes_runtime(0); // Disable magic_quotes_runtime
     75@set_magic_quotes_runtime(0); // Disable magic_quotes_runtime
    7676//
    7777// addslashes to vars if magic_quotes_gpc is off this is a security
  • trunk/tools/create_listing_file.php

    r3282 r3747  
    204204   
    205205    // Backup GD major version
    206     $pwg_conf['gd_version_full'] = ereg_replace('[[:alpha:][:space:]()]+', '', $info['GD Version']);
     206    $pwg_conf['gd_version_full'] = preg_replace('/[[:alpha:][:space:]()]+/', '', $info['GD Version']);
    207207    list($pwg_conf['gd_version_major']) = preg_split('/[.]+/', $pwg_conf['gd_version_full']);
    208208   
     
    10881088    {
    10891089      $info = gd_info();
    1090       $gd_full_version = ereg_replace('[[:alpha:][:space:]()]+', '', $info['GD Version']);
     1090      $gd_full_version = preg_replace('/[[:alpha:][:space:]()]+/', '', $info['GD Version']);
    10911091      list($gd_version) = preg_split('/[.]+/', $gd_full_version);
    10921092     
  • trunk/upload.php

    r3282 r3747  
    5858  $result = array();
    5959  $result['error'] = array();
    60   //echo $_FILES['picture']['name']."<br>".$temp_name;
     60  //echo $_FILES['picture']['name']."<br />".$temp_name;
    6161  $extension = get_extension( $_FILES['picture']['name'] );
    6262  if (!in_array($extension, $conf['picture_ext']))
     
    189189    array_push( $error, l10n('upload_filenotfound') );
    190190  }
    191   if ( !ereg( "([_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)+)",
     191  if ( !preg_match( '/([_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)+)/',
    192192             $_POST['mail_address'] ) )
    193193  {
Note: See TracChangeset for help on using the changeset viewer.