[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_3_3-4697-gf50d669

Marc Delisle lem9 at users.sourceforge.net
Sat Jun 5 14:29:12 CEST 2010


The branch, master has been updated
       via  f50d6694e79bb1f8268e44123e8b6935f10a365a (commit)
       via  c3ea6fb22bdc7c728d68388e715aeeffeaa422cb (commit)
       via  bf4fbb395a2ff3ac33272546d521904bf2b4cfee (commit)
       via  2ff0e610fce1d8687f0901991c73d054ef6f4769 (commit)
      from  7a9dd2bcd25e68253e327d93fce65d1735c016d4 (commit)


- Log -----------------------------------------------------------------
commit f50d6694e79bb1f8268e44123e8b6935f10a365a
Merge: 7a9dd2bcd25e68253e327d93fce65d1735c016d4 c3ea6fb22bdc7c728d68388e715aeeffeaa422cb
Author: Marc Delisle <marc at infomarc.info>
Date:   Sat Jun 5 08:28:24 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 7cda441..0189e96 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -96,6 +96,7 @@ $Id$
 - 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 ec2f8eb..d7333c7 100644
--- a/libraries/common.lib.php
+++ b/libraries/common.lib.php
@@ -1188,7 +1188,9 @@ function PMA_showMessage($message, $sql_query = null, $type = 'notice', $is_view
         $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 {
@@ -1766,6 +1768,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();
@@ -1787,7 +1796,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