before:

function gmap_sanitize(&$gmap){
  //sanitizes the gmap variables to reduce the possibility of javascript inserts
  foreach ($gmap as $key=>$value) {
    if ($key=='id') {
      $out = array();
      preg_match('([a-zA-Z1-9_-]*)', $value, $out);
      if (strlen($out[0])==0)  {
        $out[0]='map';
      }
      $gmap[$key]=$out[0];
    }
    else {
      $gmap[$key]=str_replace(';','',$value);
    }
  }
}

after:

function gmap_sanitize(&$gmap){
  //sanitizes the gmap variables to reduce the possibility of javascript inserts
  foreach ($gmap as $key=>$value) {
      //ibis: preg_match & str_replace not work with array
    if (!is_array($value)){ 
    if ($key=='id') {
      $out = array();
      preg_match('([a-zA-Z1-9_-]*)', $value, $out);
      if (strlen($out[0])==0)  {
        $out[0]='map';
      }
      $gmap[$key]=$out[0];
    }
    else {
      $gmap[$key]=str_replace(';','',$value); 
    }
    }
    else gmap_sanitize($value);
  }
}

Comments

bdragon’s picture

Assigned: ibis » Unassigned
Status: Needs review » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.