Use alternate bookmark-rewriting for lower PHP4 versions. May produce unexpected results, though. We should think about putting a warning string into the SQL query? This would introduce a new language variable, so I didn't do that yet.

This commit is contained in:
Garvin Hicking
2003-07-18 14:04:24 +00:00
parent 921db59bc1
commit ca08adc0ac
2 changed files with 9 additions and 1 deletions

View File

@@ -6,6 +6,10 @@ $Id$
$Source$
2003-07-18 Garvin Hicking <me@supergarv.de>
* read_dump.php3: When PHP3 < 4.3.0 is detected, try an alternative
way of rewriting bookmark variables.
* Documentation.html: Bookmark variable expansion only works with PHP
4.3.0 and above
* tbl_query_box.php3: For the querywindow - if no items are available
for the 'file import' tab, hide the 'Go' button and instead display
a warning message. Can happen if you don't have $cfg['UploadDir']

View File

@@ -52,7 +52,11 @@ if (!empty($id_bookmark)) {
case 0: // bookmarked query that have to be run
$sql_query = PMA_queryBookmarks($db, $cfg['Bookmark'], $id_bookmark);
if (isset($bookmark_variable) && !empty($bookmark_variable)) {
$sql_query = preg_replace('|/\*(.*)\[VARIABLE\](.*)\*/|imsU', '${1}' . PMA_sqlAddslashes($bookmark_variable) . '${2}', $sql_query);
if (PMA_PHP_INT_VERSION >= 40300) {
$sql_query = preg_replace('|/\*(.*)\[VARIABLE\](.*)\*/|imsU', '${1}' . PMA_sqlAddslashes($bookmark_variable) . '${2}', $sql_query);
} else {
$sql_query = preg_replace('|/\*(.*)\[VARIABLE\](.*)\*/|imsU', '\1 ' . PMA_sqlAddslashes($bookmark_variable) . '\2', $sql_query);
}
}
break;
case 1: // bookmarked query that have to be displayed