1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-08 23:57:29 +02:00

Don't store files in hidden fields

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1250 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana
2009-11-21 09:08:52 +00:00
parent 2d52e0760f
commit 3e9b1ba19f
2 changed files with 2 additions and 15 deletions

View File

@@ -296,22 +296,12 @@ function pagination($page) {
return " " . ($page == $_GET["page"] ? $page + 1 : '<a href="' . h(remove_from_uri("page") . ($page ? "&page=$page" : "")) . '">' . ($page + 1) . "</a>");
}
/** Get file contents from $_FILES or $_POST["files"]
/** Get file contents from $_FILES
* @param string
* @param bool
* @return string
* @return mixed int for error, string otherwise
*/
function get_file($key, $decompress = false) {
// returns int for error, string otherwise
$file = $_POST["files"][$key];
if (isset($file)) {
// get the file from hidden field if the user was logged out
$length = strlen($file);
if ($length && $length < 4) {
return intval($file);
}
return base64_decode($file);
}
$file = $_FILES[$key];
if (!$file || $file["error"]) {
return $file["error"];