Changeset 17


Ignore:
Timestamp:
Feb 20, 2010, 4:54:34 PM (14 years ago)
Author:
roby
Message:

Sostituite le funzioni del gruppo ereg perché divenute "deprecate" con il php 5.3

Location:
trunk
Files:
1 deleted
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/client/config.php

    r9 r17  
    99
    1010
    11 if (eregi("config.php",$_SERVER['PHP_SELF'])) {
     11if (stristr("config.php",$_SERVER['PHP_SELF'])) {
    1212        Header("Location: index.php");
    1313        die();
  • trunk/client/footer.php

    r2 r17  
    1111piede();
    1212$PHP_SELF=$_SERVER['PHP_SELF'];
    13 if (eregi("footer.php",$PHP_SELF)) {
     13if (stristr("footer.php",$PHP_SELF)) {
    1414    Header("Location: index.php");
    1515    die();
  • trunk/client/header.php

    r2 r17  
    88/* ultima modfifica: aggiunta rotazione 18 marzo 2009 */
    99
    10 if (eregi("header.php",$PHP_SELF)) {
     10if (stristr("header.php",$PHP_SELF)) {
    1111    Header("Location: index.php");
    1212    die();
  • trunk/client/modules.php

    r15 r17  
    3535
    3636foreach ($_GET as $sec_key => $secvalue) {
    37     if ((eregi("<[^>]*script*\"?[^>]*>", $secvalue)) ||
     37    if ((preg_match('/<[^>]*script*\"?[^>]*>/i', $secvalue)) ||
    3838        (eregi("<[^>]*object*\"?[^>]*>", $secvalue)) ||
    3939        (eregi("<[^>]*iframe*\"?[^>]*>", $secvalue)) ||
  • trunk/client/modules/Elezioni/affluenze.php

    r2 r17  
    236236                }
    237237
    238                 if (intval(ereg("[1-9]",$tot[$data1.$ora1]))>0) {
     238                if (intval(preg_match('/[1-9]/',$tot[$data1.$ora1]))>0) {
    239239#foreach($ar[['num_sez'] as $i)
    240240                for ($i=$sez_da;$i<=$sez_a;$i++)
  • trunk/client/modules/Elezioni/funzioni.php

    r2 r17  
    208208           
    209209            for ($i=0;$i<20;$i++) {
    210                 $link = ereg_replace(".*<link>","",$items[$i]);
    211                 $link = ereg_replace("</link>.*","",$link);
    212                 $title2 = ereg_replace(".*<title>","",$items[$i]);
    213                 $title2 = ereg_replace("</title>.*","",$title2);
     210                $link = preg_replace(".*<link>","",$items[$i]);
     211                $link = preg_replace("</link>.*","",$link);
     212                $title2 = preg_replace(".*<title>","",$items[$i]);
     213                $title2 = preg_replace("</title>.*","",$title2);
    214214                $title2 = stripslashes($title2);
    215                 $descr = ereg_replace(".*<description>","",$items[$i]);
    216                 $descr  = ereg_replace("</description>.*","",$descr );
     215                $descr = preg_replace(".*<description>","",$items[$i]);
     216                $descr  = preg_replace("</description>.*","",$descr );
    217217                $descr  = stripslashes($descr );
    218218
     
    367367$bl=opendir('modules/Elezioni/blocchi');
    368368        while ($file = readdir($bl)) {
    369                 if (!is_dir("modules/Elezioni/blocchi/$file") and (!ereg("^\.",$file)) and !stristr($file,"off_")) {
     369                if (!is_dir("modules/Elezioni/blocchi/$file") and (!preg_match('/^\./',$file)) and !stristr($file,"off_")) {
    370370                        array_push($list, $file);
    371371                }
     
    376376                sort($list);
    377377        for ($item_num=0; $item_num < count($list); $item_num++) {
    378                 $tmp=eregi_replace("^[0-9][0-9]_","",$list[$item_num]);
     378                $tmp=preg_replace('/^[0-9][0-9]_/i',"",$list[$item_num]);
    379379                $title=str_replace("_"," ",str_replace(".php","",$tmp));
    380380                // backward theme compatibility
  • trunk/client/modules/Elezioni/grafici/gd_image.inc.php

    r2 r17  
    450450        }
    451451        else {
    452             if( ereg("\n",$txt) ) {
     452            if( preg_match('/\n/',$txt) ) {
    453453                $tmp = split("\n",$txt);
    454454                for($i=0; $i < count($tmp); ++$i) {
     
    582582        }
    583583
    584         if( !ereg("\n",$txt) || ($dir>0 && ereg("\n",$txt)) ) {
     584        if( !preg_match('/\n/',$txt) || ($dir>0 && preg_match('/\n/',$txt)) ) {
    585585            // Format a single line
    586586
  • trunk/client/modules/Elezioni/gruppo.php

    r16 r17  
    8787
    8888
    89         if (ereg('circo',$op)) { //$op=='gruppo_circo' or $op=='lista_circo') {
     89        if (strstr('circo',$op)) { //$op=='gruppo_circo' or $op=='lista_circo') {
    9090                $tab1="circ";
    9191                $tab2="t5.num_circ,t5.descrizione";
     
    102102                $tipo3=_SEZIONE;
    103103        }
    104         if (ereg("gruppo",$op)){
     104        if (strstr("gruppo",$op)){
    105105                $tab="gruppo";
    106         }elseif (ereg('lista',$op)) {   
     106        }elseif (strstr('lista',$op)) {
    107107                $tab="lista";
    108108        }else{
     
    157157                $num_sez=$tot_sez;//mysql_data_seek($res_sez,0);
    158158                if ($circo) $offsetsez=$num_sez+$minsez-1;//setta offsetsez sull'ultima sezione della circoscrizione
    159                 if(ereg("circo", $op)) {
     159                if(strstr("circo", $op)) {
    160160                                $res_sez = mysql_query("SELECT count(num_circ) from ".$prefix."_ele_circoscrizione where id_cons=$id_cons",$dbi);  //estrae il numero delle circoscrizioni
    161161                                list($num_sez)=mysql_fetch_row($res_sez);
     
    178178*/
    179179                        $visvot='';
    180                         if(ereg('candidato', $op)){
     180                        if(strstr('candidato', $op)){
    181181//                      $numliste=mysql_num_rows($res_lis);
    182182                                $visvot="cand";
     
    330330                               
    331331                                echo "<tr>";
    332                                 if (!ereg('candidato',$op)) {
     332                                if (!strstr('candidato',$op)) {
    333333                                        echo "<td>"._VIS_PERC.": <input type=\"checkbox\" name=\"perc\" value=\"true\"";
    334334                                        if($perc=='true') echo " checked=\"true\"";
     
    351351
    352352                                # liste e gruppi da.... a         
    353                                 if (!ereg('candidato',$op)) {
     353                                if (!strstr('candidato',$op)) {
    354354                                      $res_cand2 = mysql_query("SELECT descrizione from ".$prefix."_ele_$tab15 where id_cons='$id_cons' and num_$tab15 ='$min'",$dbi);
    355355                                      list($descrizione)= mysql_fetch_row($res_cand2);
     
    365365
    366366                                # nome della lista
    367                                 if (ereg('candidato',$op)) {
     367                                if (strstr('candidato',$op)) {
    368368                                        $res_lis2 = mysql_query("SELECT num_lista, descrizione from ".$prefix."_ele_lista where id_lista=$id_lista",$dbi);
    369369                                        list($num_lista2,$descr_lista2)= mysql_fetch_row($res_lis2);
     
    395395                                echo "</td></tr></table></div></form>";
    396396                               
    397                                 if (ereg('candidato',$op)) echo $list2;
     397                                if (strstr('candidato',$op)) echo $list2;       
    398398                               
    399399                               
  • trunk/client/modules/Elezioni/tema.php

    r2 r17  
    1818        while ($file = readdir($handle)) {
    1919
    20                         if ( (ereg("^([_0-9a-zA-Z]+)([_0-9a-zA-Z]{3})$",$file)) ) {
     20                        if ( (preg_match('/^([_0-9a-zA-Z]+)([_0-9a-zA-Z]{3})$/',$file)) ) {
    2121
    2222                   $tlist .= "$file ";
  • trunk/client/temi/facebook/menu.php

    r2 r17  
    243243        for ($i=0; $i < sizeof($menulist); $i++) {
    244244                if($menulist[$i]!="") {
    245                         $tl = ereg_replace("lang-","",$menulist[$i]);
    246                         $tl = ereg_replace(".php","",$tl);
     245                        $tl = preg_replace("lang-","",$menulist[$i]);
     246                        $tl = preg_replace(".php","",$tl);
    247247                        $altlang = ucfirst($tl);
    248248                       
  • trunk/client/temi/facebook/tema.php

    r2 r17  
    1919        while ($file = readdir($handle)) {
    2020
    21                         if ( (ereg("^([_0-9a-zA-Z]+)([_0-9a-zA-Z]{3})$",$file)) ) {
     21                        if ( (preg_match('/^([_0-9a-zA-Z]+)([_0-9a-zA-Z]{3})$/',$file)) ) {
    2222
    2323                   $tlist .= "$file ";
  • trunk/client/temi/inc/button.php

    r2 r17  
    2222        for ($i=0; $i < sizeof($menulist); $i++) {
    2323                if($menulist[$i]!="") {
    24                         $tl = ereg_replace("lang-","",$menulist[$i]);
    25                         $tl = ereg_replace(".php","",$tl);
     24                        $tl = preg_replace("lang-","",$menulist[$i]);
     25                        $tl = preg_replace(".php","",$tl);
    2626                        $altlang = ucfirst($tl);
    2727                       
  • trunk/client/temi/tour/button.php

    r2 r17  
    3131        for ($i=0; $i < sizeof($menulist); $i++) {
    3232                if($menulist[$i]!="") {
    33                         $tl = ereg_replace("lang-","",$menulist[$i]);
    34                         $tl = ereg_replace(".php","",$tl);
     33                        $tl = preg_replace("lang-","",$menulist[$i]);
     34                        $tl = preg_replace(".php","",$tl);
    3535                        $altlang = ucfirst($tl);
    3636                       
  • trunk/install/install2.php

    r2 r17  
    147147function split_sql($sql) {
    148148        $sql = trim($sql);
    149         $sql = ereg_replace("\n#[^\n]*\n", "\n", $sql);
     149        $sql = preg_replace('/\n#[^\n]*\n/', "\n", $sql);
    150150
    151151        $buffer = array();
     
    417417                                        $handle=opendir('../client/temi');
    418418                                        while ($file = readdir($handle)) {
    419                                           if ( (!ereg("[.]",$file)) ) {
     419                                          if ( (!preg_match('/[.]/',$file)) ) {
    420420                                            $themelist .= "$file ";
    421421                                          }
  • trunk/install/install4.php

    r2 r17  
    216216$config .= "\n";
    217217$config .= "\n";
    218 $config .= "if (eregi(\"config.php\",\$_SERVER['PHP_SELF'])) {\n";
     218$config .= "if (stristr(\"config.php\",\$_SERVER['PHP_SELF'])) {\n";
    219219$config .= "        Header(\"Location: index.php\");\n";
    220220$config .= "    die();\n";
     
    253253$config_adm .= "\n";
    254254$config_adm .= "\n";
    255 $config_adm .= "if (eregi(\"config.php\",\$_SERVER['PHP_SELF'])) {\n";
     255$config_adm .= "if (stristr(\"config.php\",\$_SERVER['PHP_SELF'])) {\n";
    256256$config_adm .= "        Header(\"Location: index.php\");\n";
    257257$config_adm .= "        die();\n";
Note: See TracChangeset for help on using the changeset viewer.