]> git.joonet.de Git - adminer.git/commitdiff
More thorough escaping
authorJakub Vrana <jakub@vrana.cz>
Wed, 27 Jul 2011 06:58:07 +0000 (08:58 +0200)
committerJakub Vrana <jakub@vrana.cz>
Wed, 27 Jul 2011 06:58:07 +0000 (08:58 +0200)
adminer/include/functions.inc.php

index 89b393dd069435eda845fab922c552872335d9a0..51ee0e0d2a66ef232be5abeb69bf3560a128c402 100644 (file)
@@ -93,7 +93,7 @@ function nl_br($string) {
 function checkbox($name, $value, $checked, $label = "", $onclick = "", $jsonly = false) {
        static $id = 0;
        $id++;
-       $return = "<input type='checkbox' name='$name' value='" . h($value) . "'" . ($checked ? " checked" : "") . ($onclick ? " onclick=\"$onclick\"" : "") . ($jsonly ? " class='jsonly'" : "") . " id='checkbox-$id'>";
+       $return = "<input type='checkbox' name='$name' value='" . h($value) . "'" . ($checked ? " checked" : "") . ($onclick ? ' onclick="' . h($onclick) . '"' : '') . ($jsonly ? " class='jsonly'" : "") . " id='checkbox-$id'>";
        return ($label != "" ? "<label for='checkbox-$id'>$return" . h($label) . "</label>" : $return);
 }
 
@@ -864,7 +864,7 @@ function is_url($string) {
 * @return null
 */
 function print_fieldset($id, $legend, $visible = false, $onclick = "") {
-       echo "<fieldset><legend><a href='#fieldset-$id' onclick=\"$onclick" . "return !toggle('fieldset-$id');\">$legend</a></legend><div id='fieldset-$id'" . ($visible ? "" : " class='hidden'") . ">\n";
+       echo "<fieldset><legend><a href='#fieldset-$id' onclick=\"" . h($onclick) . "return !toggle('fieldset-$id');\">$legend</a></legend><div id='fieldset-$id'" . ($visible ? "" : " class='hidden'") . ">\n";
 }
 
 /** Return class='active' if $bold is true