]> git.joonet.de Git - adminer.git/commitdiff
Don't encode binary files
authorJakub Vrana <jakub@vrana.cz>
Sun, 2 Sep 2012 13:45:45 +0000 (06:45 -0700)
committerJakub Vrana <jakub@vrana.cz>
Fri, 7 Sep 2012 15:30:31 +0000 (08:30 -0700)
adminer/file.inc.php
compile.php
todo.txt

index d2ab6db602825b87ed357da73f8b28f283cf8b08..332e58fad8e465f51caa61d739e772c8fecd5549 100644 (file)
@@ -3,21 +3,21 @@ header("Expires: " . gmdate("D, d M Y H:i:s", time() + 365*24*60*60) . " GMT");
 
 if ($_GET["file"] == "favicon.ico") {
        header("Content-Type: image/x-icon");
-       echo base64_decode("compile_file('../adminer/static/favicon.ico', 'base64_encode');");
+       echo 'compile_file("../adminer/static/favicon.ico", "add_apo_slashes");';
 } elseif ($_GET["file"] == "default.css") {
        header("Content-Type: text/css; charset=utf-8");
-       ?>compile_file('../adminer/static/default.css', 'minify_css');<?php
+       ?>compile_file("../adminer/static/default.css", "minify_css");<?php
 } elseif ($_GET["file"] == "functions.js") {
        header("Content-Type: text/javascript; charset=utf-8");
-       ?>compile_file('../adminer/static/functions.js', 'jsShrink');compile_file('static/editing.js', 'jsShrink');<?php
+       ?>compile_file("../adminer/static/functions.js", "jsShrink");compile_file("static/editing.js", "jsShrink");<?php
 } else {
        header("Content-Type: image/gif");
        switch ($_GET["file"]) {
-               case "plus.gif": echo base64_decode("compile_file('../adminer/static/plus.gif', 'base64_encode');"); break;
-               case "cross.gif": echo base64_decode("compile_file('../adminer/static/cross.gif', 'base64_encode');"); break;
-               case "up.gif": echo base64_decode("compile_file('../adminer/static/up.gif', 'base64_encode');"); break;
-               case "down.gif": echo base64_decode("compile_file('../adminer/static/down.gif', 'base64_encode');"); break;
-               case "arrow.gif": echo base64_decode("compile_file('../adminer/static/arrow.gif', 'base64_encode');"); break;
+               case "plus.gif": echo 'compile_file("../adminer/static/plus.gif", "add_apo_slashes");'; break;
+               case "cross.gif": echo 'compile_file("../adminer/static/cross.gif", "add_apo_slashes");'; break;
+               case "up.gif": echo 'compile_file("../adminer/static/up.gif", "add_apo_slashes");'; break;
+               case "down.gif": echo 'compile_file("../adminer/static/down.gif", "add_apo_slashes");'; break;
+               case "arrow.gif": echo 'compile_file("../adminer/static/arrow.gif", "add_apo_slashes");'; break;
        }
 }
 exit;
index 8ebb22c93196e4f1efaf8483ad39efc2c77f254d..e21b3744a8b1b5b55b7875975512ed0347b847e1 100755 (executable)
@@ -328,7 +328,7 @@ foreach (array("adminer", "editor") as $project) {
                $file = str_replace('<?php echo $LANG; ?>', $_SESSION["lang"], $file);
        }
        $file = str_replace('<script type="text/javascript" src="static/editing.js"></script>' . "\n", "", $file);
-       $file = preg_replace_callback("~compile_file\\('([^']+)', '([^']+)'\\);~", 'compile_file', $file); // integrate static files
+       $file = preg_replace_callback('~compile_file\\("([^"]+)", "([^"]+)"\\);~', 'compile_file', $file); // integrate static files
        $replace = 'h(preg_replace("~\\\\\\\\?.*~", "", ME)) . "?file=\\1&amp;version=' . $VERSION;
        $file = preg_replace('~\\.\\./adminer/static/(default\\.css|functions\\.js|favicon\\.ico)~', '<?php echo ' . $replace . '"; ?>', $file);
        $file = preg_replace('~\\.\\./adminer/static/([^\'"]*)~', '" . ' . $replace, $file);
index 89f0bb5d3688c9bb35105bdd740ea4dbf84e7f30..4c59583be12e261b19ffa427eab217dec4bc0030 100644 (file)
--- a/todo.txt
+++ b/todo.txt
@@ -13,7 +13,7 @@ Selectable <option>(on update)<option>CURRENT_TIMESTAMP for timestamp - https://
 ? Filter by value in row under <thead> in select
 ? Column and table names auto-completition in SQL textarea - http://blog.quplo.com/2010/06/css-code-completion-in-your-browser/
 ? Aliasing of built-in functions can save 7 KB, function minification can save 7 KB, substitution of repetitive $a["a"] can save 4 KB, substitution of $_GET and friends can save 2 KB, aliasing of $connection->query can save 24 B, JS Closure compiler can save 2 KB, not enclosing HTML attribute values can save 1.2 KB, replacing \\n by \n can save .3 KB
-? Branch binary_compile: LZW compression of translations can save 30 KB, LZW compression of all texts can save 11 KB, remove of base64_decode() + using chars 127-255 in minification can save 1 KB
+? Branch binary_compile: LZW compression of all texts can save 11 KB, using chars 127-255 in minification can save 1 KB
 
 Editor:
 Three-state checkbox for boolean searches