Changeset 347 for trunk/client/inc


Ignore:
Timestamp:
May 14, 2021, 2:00:23 PM (3 years ago)
Author:
roby
Message:

Aggiornamento per compatibilità con php7.4

Location:
trunk/client/inc
Files:
639 added
2 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/client/inc/csrf-magic/csrf-magic.php

    r253 r347  
    157157    $buffer = preg_replace('#(<form[^>]*method\s*=\s*["\']post["\'][^>]*>)#i', '$1' . $input, $buffer);
    158158    if ($GLOBALS['csrf']['frame-breaker']) {
    159         $buffer = str_ireplace('</head>', '<script type="text/javascript">if (top != self) {top.location.href = self.location.href;}</script></head>', $buffer);
     159        $buffer = str_ireplace('</head>', '<script>if (top != self) {top.location.href = self.location.href;}</script></head>', $buffer);
    160160    }
    161161    if ($js = $GLOBALS['csrf']['rewrite-js']) {
    162162        $buffer = str_ireplace(
    163163            '</head>',
    164             '<script type="text/javascript">'.
     164            '<script">'.
    165165                'var csrfMagicToken = "'.$tokens.'";'.
    166166                'var csrfMagicName = "'.$name.'";</script>'.
     
    168168            $buffer
    169169        );
    170         $script = '<script type="text/javascript">CsrfMagic.end();</script>';
     170        $script = '<script>CsrfMagic.end();</script>';
    171171        $buffer = str_ireplace('</body>', $script . '</body>', $buffer, $count);
    172172        if (!$count) {
  • trunk/client/inc/javascript.php

    r247 r347  
    4242# googlemaps per sezioni
    4343# variabili nel config.php
    44 # gkey= chiave google reperibile per il proprio sito qui
    45 # http://code.google.com/intl/it/apis/maps/signup.html
     44# gkey= chiave google informazioni su come reperirla per il proprio sito qui
     45# https://cloud.google.com/maps-platform/user-guide/account-changes/#no-plan
    4646# googlemaps 1=attivo 2: disattivo
    4747# funzione by eleonline.it
     
    5858# recupera gli inidirizzi
    5959    $id_sede=$_GET['id_sede'];
    60     $sql = mysql_query("SELECT descrizione FROM ".$prefix."_ele_comuni where id_comune='$id_comune' ", $dbi);
    61     list($comune) = mysql_fetch_row($sql);
    62     $sql = mysql_query("select indirizzo from ".$prefix."_ele_sede where id_sede='$id_sede'", $dbi);
    63     list($indirizzo)=mysql_fetch_row($sql);
     60        $sql="SELECT descrizione FROM ".$prefix."_ele_comuni where id_comune='$id_comune' ";
     61        $res = $dbi->prepare("$sql");
     62        $res->execute();
     63        list($comune) = $res->fetch(PDO::FETCH_NUM);
     64        $sql="SELECT indirizzo from ".$prefix."_ele_sede where id_sede='$id_sede' ";
     65        $res = $dbi->prepare("$sql");
     66        $res->execute();
     67        list($indirizzo) = $res->fetch(PDO::FETCH_NUM);
     68
    6469    $address=rawurlencode("$indirizzo,$comune,58047");
    6570
    6671        $resultGeoCode=file_get_contents('http://maps.google.com/maps/api/geocode/json?address='.$address.'&amp;sensor=false');
    67 
    6872        $output= json_decode($resultGeoCode);
    6973       
     
    7276                $longitude      = $output->results[0]->geometry->location->lng; // Returns Longitude
    7377                $location       = $output->results[0]->formatted_address;
     78        }else{
     79                $latitude=0;
     80                $longitude=0;
     81                $location='';
    7482        }
    7583
     
    108116
    109117
    110 
     118# type="text/javascript"
    111119
    112120
    113121echo '
    114 <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true&language=it"></script>
    115    <script type="text/javascript">
     122<script src="http://maps.google.com/maps/api/js?sensor=true&language=it"></script>
     123   <script>
    116124      function maps() {
    117125         var latlng = new google.maps.LatLng('.$coords['lat'].','.$coords['long'].'); // centro della mappa
Note: See TracChangeset for help on using the changeset viewer.