Ignore:
Timestamp:
01/09/2010 05:02:33 PM (2 years ago)
Author:
Acinonyx
Message:

[awmn] Escape HTML special characters

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/awmn/globals/functions.php

    r229 r230  
    44 * 
    55 * Copyright (C) 2005 Nikolaos Nikalexis <winner@cube.gr> 
    6  * Copyright (C) 2009 Vasilis Tsiligiannis <b_tsiligiannis@silverton.gr> 
     6 * Copyright (C) 2009-2010 Vasilis Tsiligiannis <b_tsiligiannis@silverton.gr> 
    77 *  
    88 * This program is free software; you can redistribute it and/or modify 
     
    3939} 
    4040 
    41 function get_qs() { 
     41function get_qs($htmlspecialchars=TRUE) { 
     42        $ret = ""; 
    4243        if ($_SERVER['REQUEST_METHOD'] == 'GET') { 
    43                 return $_SERVER['QUERY_STRING']; 
    44         } else { 
    45                 return $_POST['query_string']; 
    46         } 
     44                $ret = $_SERVER['QUERY_STRING']; 
     45        } else { 
     46                $ret = $_POST['query_string']; 
     47        } 
     48        return ($htmlspecialchars?htmlspecialchars($ret):$ret); 
    4749} 
    4850 
     
    105107        if(get('show_map') == "no") $o = array_merge($o,array("show_map" => "no")); 
    106108        if ($cur_qs == TRUE) { 
    107                 parse_str(get_qs(), $qs); 
     109                parse_str(get_qs(FALSE), $qs); 
    108110                $o = array_merge($o, $qs); 
    109111        } 
     
    338340        if ($gmap_key == '') return FALSE; 
    339341         
    340         $main->html->head->add_script("text/javascript", "http://".$vars['gmap']['server']."/maps?file=api&v=".$vars['gmap']['api']."&key=".$gmap_key."&hl=".$lang["iso639"]); 
     342        $main->html->head->add_script("text/javascript", htmlspecialchars("http://".$vars['gmap']['server']."/maps?file=api&v=".$vars['gmap']['api']."&key=".$gmap_key."&hl=".$lang["iso639"])); 
    341343        $main->html->head->add_script("text/javascript", $javascript); 
    342344        $main->html->head->add_extra( 
Note: See TracChangeset for help on using the changeset viewer.