Skip to content
Browse files

Emulate REQUEST_URI

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@934 7c3ca157-0c34-0410-bff1-cbf682f78f5c
  • Loading branch information...
1 parent 8f525c4 commit d31d4e9e525549189ed3ef42923960bb9a3d3438 jakubvrana committed Jul 28, 2009
Showing with 6 additions and 4 deletions.
  1. +4 −1 adminer/include/bootstrap.inc.php
  2. +1 −1 adminer/include/editing.inc.php
  3. +1 −1 compile.php
  4. +0 −1 editor/include/adminer.inc.php
View
5 adminer/include/bootstrap.inc.php
@@ -64,7 +64,10 @@
}
set_magic_quotes_runtime(false);
-$SELF = (isset($_SERVER["REQUEST_URI"]) ? preg_replace('~^[^?]*/([^?]*).*~', '\\1', $_SERVER["REQUEST_URI"]) : $_SERVER["ORIG_PATH_INFO"]) . '?' . (strlen($_GET["server"]) ? 'server=' . urlencode($_GET["server"]) . '&' : '') . (strlen($_GET["db"]) ? 'db=' . urlencode($_GET["db"]) . '&' : '');
+if (!isset($_SERVER["REQUEST_URI"])) {
+ $_SERVER["REQUEST_URI"] = $_SERVER["ORIG_PATH_INFO"] . (strlen($_SERVER["QUERY_STRING"]) ? "?$_SERVER[QUERY_STRING]" : "");
+}
+$SELF = preg_replace('~^[^?]*/([^?]*).*~', '\\1', $_SERVER["REQUEST_URI"]) . '?' . (strlen($_GET["server"]) ? 'server=' . urlencode($_GET["server"]) . '&' : '') . (strlen($_GET["db"]) ? 'db=' . urlencode($_GET["db"]) . '&' : '');
$on_actions = array("RESTRICT", "CASCADE", "SET NULL", "NO ACTION"); // used in foreign_keys()
include "../adminer/include/version.inc.php";
View
2 adminer/include/editing.inc.php
@@ -56,7 +56,7 @@ function type_class($type) {
}
function edit_fields($fields, $collations, $type = "TABLE", $allowed = 0, $foreign_keys = array()) {
- global $inout, $SELF; // $SELF is used by compiled images
+ global $inout;
$column_comments = false;
foreach ($fields as $field) {
if (strlen($field["comment"])) {
View
2 compile.php
@@ -177,7 +177,7 @@ function compile_file($match) {
}
$file = str_replace('<script type="text/javascript" src="editing.js"></script>' . "\n", "", $file);
$file = preg_replace_callback("~compile_file\\('([^']+)', '([^']+)'\\);~", 'compile_file', $file); // integrate static files
-$replace = 'htmlspecialchars(preg_replace("~\\\\\\\\?.*~", "", $SELF), ENT_QUOTES) . "?file=\\1&amp;version=' . $VERSION;
+$replace = 'htmlspecialchars(preg_replace("~\\\\\\\\?.*~", "", $_SERVER["REQUEST_URI"]), ENT_QUOTES) . "?file=\\1&amp;version=' . $VERSION;
$file = preg_replace('~\\.\\./adminer/(default\\.css|functions\\.js|favicon\\.ico)~', '<?php echo ' . $replace . '"; ?>', $file);
$file = preg_replace('~\\.\\./adminer/((plus|cross|up|down|arrow)\\.gif)~', '" . ' . $replace, $file);
$file = str_replace("../externals/jush/", "http://jush.sourceforge.net/", $file);
View
1 editor/include/adminer.inc.php
@@ -108,7 +108,6 @@ function rowDescriptions($rows, $foreignKeys) {
}
function selectVal($val, $link, $field) {
- global $SELF; // used by compiled images
$return = ($val == "<i>NULL</i>" ? "&nbsp;" : $val);
if (ereg('blob|binary', $field["type"]) && !is_utf8($val)) {
$return = lang('%d byte(s)', strlen($val));

0 comments on commit d31d4e9

Please sign in to comment.
Something went wrong with that request. Please try again.