From ca08adc0ac4c3f9047b0fff9b3c94ff86a074154 Mon Sep 17 00:00:00 2001 From: Garvin Hicking Date: Fri, 18 Jul 2003 14:04:24 +0000 Subject: [PATCH] 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. --- ChangeLog | 4 ++++ read_dump.php3 | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 59b071e8c..9638da6a1 100755 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,10 @@ $Id$ $Source$ 2003-07-18 Garvin Hicking + * 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'] diff --git a/read_dump.php3 b/read_dump.php3 index e1c01418e..2385c787d 100644 --- a/read_dump.php3 +++ b/read_dump.php3 @@ -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