[Phpmyadmin-git] [SCM] phpMyAdmin branch, QA_3_3, updated. RELEASE_3_3_3-34-gc3ea6fb

Marc Delisle lem9 at users.sourceforge.net
Sat Jun 5 14:20:47 CEST 2010


The branch, QA_3_3 has been updated
       via  c3ea6fb22bdc7c728d68388e715aeeffeaa422cb (commit)
      from  bf4fbb395a2ff3ac33272546d521904bf2b4cfee (commit)


- Log -----------------------------------------------------------------
commit c3ea6fb22bdc7c728d68388e715aeeffeaa422cb
Author: Marc Delisle <marc at infomarc.info>
Date:   Sat Jun 5 08:20:36 2010 -0400

    bug #3011126 [display] Edit link missing after long query

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                |    1 +
 libraries/common.lib.php |   13 +++++++++++--
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index dca8ffe..395def4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -16,6 +16,7 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA
 - bug [synchronize] Rows were deleted in target table regardless of the
   "Would you like to delete..." option
 - bug [privileges] List of tables not shown when the db name has a wildcard
+- bug #3011126 [display] Edit link missing after long query
 
 3.3.3.0 (2010-05-10)
 - patch #2982480 [navi] Do not group if there would be one table in group,
diff --git a/libraries/common.lib.php b/libraries/common.lib.php
index 2e18474..c62d518 100644
--- a/libraries/common.lib.php
+++ b/libraries/common.lib.php
@@ -1191,7 +1191,9 @@ function PMA_showMessage($message, $sql_query = null, $type = 'notice')
         $url_params['sql_query']  = $sql_query;
         $url_params['show_query'] = 1;
 
-        if (! empty($cfg['SQLQuery']['Edit']) && ! $query_too_big) {
+        // even if the query is big and was truncated, offer the chance
+        // to edit it (unless it's enormous, see PMA_linkOrButton() )
+        if (! empty($cfg['SQLQuery']['Edit'])) {
             if ($cfg['EditInWindow'] == true) {
                 $onclick = 'window.parent.focus_querywindow(\'' . PMA_jsFormat($sql_query, false) . '\'); return false;';
             } else {
@@ -1689,6 +1691,13 @@ function PMA_generate_html_tabs($tabs, $url_params)
 function PMA_linkOrButton($url, $message, $tag_params = array(),
     $new_form = true, $strip_img = false, $target = '')
 {
+    $url_length = strlen($url);
+    // with this we should be able to catch case of image upload
+    // into a (MEDIUM) BLOB; not worth generating even a form for these
+    if ($url_length > $GLOBALS['cfg']['LinkLengthLimit'] * 100) {
+        return '';
+    }
+
     if (! is_array($tag_params)) {
         $tmp = $tag_params;
         $tag_params = array();
@@ -1710,7 +1719,7 @@ function PMA_linkOrButton($url, $message, $tag_params = array(),
         $tag_params_strings[] = $par_name . '="' . $par_value . '"';
     }
 
-    if (strlen($url) <= $GLOBALS['cfg']['LinkLengthLimit']) {
+    if ($url_length <= $GLOBALS['cfg']['LinkLengthLimit']) {
         // no whitespace within an <a> else Safari will make it part of the link
         $ret = "\n" . '<a href="' . $url . '" '
             . implode(' ', $tag_params_strings) . '>'


hooks/post-receive
-- 
phpMyAdmin




More information about the Git mailing list