You've already forked phpmyadmin
mirror of
https://github.com/phpmyadmin/phpmyadmin.git
synced 2026-10-23 18:29:15 +03:00
Fix Uncaught ReferenceError: CodeMirror is not defined
Signed-off-by: Liviu-Mihail Concioiu <liviu.concioiu@gmail.com>
This commit is contained in:
@@ -35,7 +35,8 @@ class Text_Plain_JsonEditor extends CodeMirrorEditorTransformationPlugin
|
||||
public function getScripts()
|
||||
{
|
||||
$scripts = [];
|
||||
if ($GLOBALS['cfg']['CodemirrorEnable']) {
|
||||
// See #20159, why we need to check for HTTP_USER_AGENT here
|
||||
if ($GLOBALS['cfg']['CodemirrorEnable'] && isset($_SERVER['HTTP_USER_AGENT'])) {
|
||||
$scripts[] = 'vendor/codemirror/lib/codemirror.js';
|
||||
$scripts[] = 'vendor/codemirror/mode/javascript/javascript.js';
|
||||
$scripts[] = 'transformations/json_editor.js';
|
||||
|
||||
@@ -35,7 +35,8 @@ class Text_Plain_SqlEditor extends CodeMirrorEditorTransformationPlugin
|
||||
public function getScripts()
|
||||
{
|
||||
$scripts = [];
|
||||
if ($GLOBALS['cfg']['CodemirrorEnable']) {
|
||||
// See #20159, why we need to check for HTTP_USER_AGENT here
|
||||
if ($GLOBALS['cfg']['CodemirrorEnable'] && isset($_SERVER['HTTP_USER_AGENT'])) {
|
||||
$scripts[] = 'vendor/codemirror/lib/codemirror.js';
|
||||
$scripts[] = 'vendor/codemirror/mode/sql/sql.js';
|
||||
$scripts[] = 'transformations/sql_editor.js';
|
||||
|
||||
@@ -35,7 +35,8 @@ class Text_Plain_XmlEditor extends CodeMirrorEditorTransformationPlugin
|
||||
public function getScripts()
|
||||
{
|
||||
$scripts = [];
|
||||
if ($GLOBALS['cfg']['CodemirrorEnable']) {
|
||||
// See #20159, why we need to check for HTTP_USER_AGENT here
|
||||
if ($GLOBALS['cfg']['CodemirrorEnable'] && isset($_SERVER['HTTP_USER_AGENT'])) {
|
||||
$scripts[] = 'vendor/codemirror/lib/codemirror.js';
|
||||
$scripts[] = 'vendor/codemirror/mode/xml/xml.js';
|
||||
$scripts[] = 'transformations/xml_editor.js';
|
||||
|
||||
@@ -21,7 +21,8 @@ class Text_Plain_Json extends TransformationsPlugin
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
if (empty($GLOBALS['cfg']['CodemirrorEnable'])) {
|
||||
// See #20159, why we need to check for HTTP_USER_AGENT here
|
||||
if (empty($GLOBALS['cfg']['CodemirrorEnable']) || ! isset($_SERVER['HTTP_USER_AGENT'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,8 @@ class Text_Plain_Sql extends SQLTransformationsPlugin
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
if (empty($GLOBALS['cfg']['CodemirrorEnable'])) {
|
||||
// See #20159, why we need to check for HTTP_USER_AGENT here
|
||||
if (empty($GLOBALS['cfg']['CodemirrorEnable']) || ! isset($_SERVER['HTTP_USER_AGENT'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,8 @@ class Text_Plain_Xml extends TransformationsPlugin
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
if (empty($GLOBALS['cfg']['CodemirrorEnable'])) {
|
||||
// See #20159, why we need to check for HTTP_USER_AGENT here
|
||||
if (empty($GLOBALS['cfg']['CodemirrorEnable']) || ! isset($_SERVER['HTTP_USER_AGENT'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user