Permalink
Browse files

Shorten NUL byte

  • Loading branch information...
1 parent 9a30f14 commit 2264e090217990eda8abc84fccdf324882d8850c @vrana committed Sep 18, 2012
Showing with 6 additions and 2 deletions.
  1. +1 −1 adminer/file.inc.php
  2. +5 −1 compile.php
View
@@ -9,7 +9,7 @@
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'));
View
@@ -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) {

0 comments on commit 2264e09

Please sign in to comment.