Changeset 23 for trunk/admin


Ignore:
Timestamp:
Mar 5, 2010, 1:53:30 PM (14 years ago)
Author:
roby
Message:

Gestione charset con query mysql e sostituzione funzioni ereg

Location:
trunk/admin
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/admin.php

    r21 r23  
    124124                $dbi=mysql_connect($dbhost, $dbuname, $dbpass) or die("Connessione non riuscita: " . mysql_error());
    125125                mysql_select_db($dbname)or die("Connessione non riuscita:" . mysql_error());
    126 #               mysql_set_charset('utf8', $dbi);
    127126        mysql_query("SET NAMES 'utf8'", $dbi);
    128127//---10/05/2009  gestione consultazione predefinita
  • trunk/admin/footer.php

    r2 r23  
    88
    99$PHP_SELF=$_SERVER['PHP_SELF'];
    10 if (eregi("footer.php",$PHP_SELF)) {
     10if (preg_match("/footer.php/i",$PHP_SELF)) {
    1111    Header("Location: admin.php");
    1212    die();
  • trunk/admin/inc/FCKeditor/editor/filemanager/browser/default/connectors/php/connector.php

    r2 r23  
    5353        $GLOBALS["UserFilesPath"] = $strBP ;
    5454}
    55 if ( ! ereg( '/$', $GLOBALS["UserFilesPath"] ) )
     55if ( ! preg_match( '/\/$/', $GLOBALS["UserFilesPath"] ) )
    5656        $GLOBALS["UserFilesPath"] .= '/' ;
    5757
     
    6060        $GLOBALS["UserFilesDirectory"] = $Config['UserFilesAbsolutePath'] ;
    6161
    62         if ( ! ereg( '/$', $GLOBALS["UserFilesDirectory"] ) )
     62        if ( ! preg_match( '/\/$/', $GLOBALS["UserFilesDirectory"] ) )
    6363                $GLOBALS["UserFilesDirectory"] .= '/' ;
    6464}
     
    8686
    8787        // Check the current folder syntax (must begin and start with a slash).
    88         if ( ! ereg( '/$', $sCurrentFolder ) ) $sCurrentFolder .= '/' ;
     88        if ( ! preg_match( '/\/$/', $sCurrentFolder ) ) $sCurrentFolder .= '/' ;
    8989        if ( strpos( $sCurrentFolder, '/' ) !== 0 ) $sCurrentFolder = '/' . $sCurrentFolder ;
    9090       
  • trunk/admin/index.php

    r15 r23  
    1010                $dbi=mysql_connect($dbhost, $dbuname, $dbpass) or die("Connessione non riuscita: " . mysql_error());
    1111                mysql_select_db($dbname)or die("Connessione non riuscita:" . mysql_error());
    12                 mysql_set_charset('utf8', $dbi);
     12        mysql_query("SET NAMES 'utf8'", $dbi);
    1313//---10/05/2009  gestione consultazione predefinita
    1414//if (!isset($_SESSION['id_comune'])){
  • trunk/admin/modules/Elezioni/controllo_votanti.php

    r2 r23  
    130130                }
    131131//      $ar['riga2'][$data1.$ora1]="<hr>";
    132                 if (intval(ereg("[1-9]",$tot[$data1.$ora1]))>0) {
     132                if (intval(preg_match("/[1-9]/",$tot[$data1.$ora1]))>0) {
    133133                        for ($i=1;$i<=$num_sez;$i++)
    134134                        {
  • trunk/admin/modules/Elezioni/ele_come.php

    r2 r23  
    138138
    139139$temp=$title.$preamble.$content;
    140         if (eregi("script",$temp)) die("La parola script e' proibita, devi toglierla dal testo.");
     140        if (preg_match("/script/i",$temp)) die("La parola script e' proibita, devi toglierla dal testo.");
    141141    $result = mysql_query("update ".$prefix.$tab." set title='$title', preamble='$preamble', content='$content' WHERE mid='$mid' AND id_cons='$id_cons'", $dbi);
    142142    Header("Location: admin.php?op=$op&vai=come&id_cons_gen=$id_cons_gen");
  • trunk/admin/modules/Elezioni/ele_voti.php

    r2 r23  
    11121112
    11131113
    1114         if (!ereg("rec",$op)) {
     1114        if (!preg_match("/rec/",$op)) {
    11151115                ele(); //menu
    11161116                numeri_sezione();
  • trunk/admin/temi/facebook/menu.php

    r2 r23  
    227227        for ($i=0; $i < sizeof($menulist); $i++) {
    228228                if($menulist[$i]!="") {
    229                         $tl = ereg_replace("lang-","",$menulist[$i]);
    230                         $tl = ereg_replace(".php","",$tl);
     229                        $tl = preg_replace("/lang-/","",$menulist[$i]);
     230                        $tl = preg_replace("/.php/","",$tl);
    231231                        $altlang = ucfirst($tl);
    232232                       
  • trunk/admin/temi/facebook/tema.php

    r2 r23  
    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 ";
Note: See TracChangeset for help on using the changeset viewer.