diff --git a/ChangeLog b/ChangeLog index b3d8b97b91..c2418502cd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -35,6 +35,7 @@ phpMyAdmin - ChangeLog - issue #13386 Avoid PHP errors with non existing configuration on OS X - issue #13388 Show only supported charsets for conversion - issue #13392 Fixed operation with session.auto_start enabled +- issue #13383 "Create PHP code" is broken 4.7.1 (2017-05-25) - issue #13132 Always execute tracking queries as controluser diff --git a/libraries/Util.php b/libraries/Util.php index bfb3bbfbc8..730f788c7d 100644 --- a/libraries/Util.php +++ b/libraries/Util.php @@ -1018,15 +1018,14 @@ class Util if (! empty($GLOBALS['show_as_php'])) { $new_line = '\\n"
' . "\n" . '    . "'; - $query_base = '$sql = \'' . $query_base; - $query_base = '
' . "\n"
-                    . htmlspecialchars(addslashes($query_base));
+                $query_base = htmlspecialchars(addslashes($query_base));
                 $query_base = preg_replace(
                     '/((\015\012)|(\015)|(\012))/',
                     $new_line,
                     $query_base
                 );
-                $query_base = '$sql  = \'' . $query_base . '"';
+                $query_base = '
' . "\n"
+                    . '$sql = "' . $query_base;
             } elseif ($query_too_big) {
                 $query_base = htmlspecialchars($query_base);
             } else {
@@ -1170,7 +1169,7 @@ class Util
 
             //Clean up the end of the PHP
             if (! empty($GLOBALS['show_as_php'])) {
-                $retval .= '\';' . "\n"
+                $retval .= '";' . "\n"
                     . '
'; } $retval .= '';