]> git.joonet.de Git - adminer.git/commitdiff
Shorten NUL byte
authorJakub Vrana <jakub@vrana.cz>
Tue, 18 Sep 2012 17:41:25 +0000 (10:41 -0700)
committerJakub Vrana <jakub@vrana.cz>
Wed, 19 Sep 2012 22:43:02 +0000 (15:43 -0700)
adminer/file.inc.php
compile.php

index 6a137e1b5c6f82be1a49e3c116826fa169a8a0c7..4c5216e1609f9760e2387c0ec9f500d7312c54e3 100644 (file)
@@ -9,7 +9,7 @@ header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
 
 if ($_GET["file"] == "favicon.ico") {
        header("Content-Type: image/x-icon");
-       echo compile_file('../adminer/static/favicon.ico');
+       echo base64_decode(compile_file('../adminer/static/favicon.ico', 'base64_encode'));
 } elseif ($_GET["file"] == "default.css") {
        header("Content-Type: text/css; charset=utf-8");
        echo lzw_decompress(compile_file('../adminer/static/default.css', 'minify_css'));
index 439d574154c4257b3f53cd10a29542010621bb89..706981ce3d68147a39178adb983c7a662d7b4b99 100755 (executable)
@@ -9,7 +9,11 @@ function add_apo_slashes($s) {
 }
 
 function add_quo_slashes($s) {
-       return addcslashes($s, "\n\r\$\0\"\\");
+       $return = $s;
+       $return = addcslashes($return, "\n\r\$\"\\");
+       $return = preg_replace('~\0(?![0-7])~', '\\\\0', $return);
+       $return = addcslashes($return, "\0");
+       return $return;
 }
 
 function remove_lang($match) {