关于php:phpMyadmin错误”继续”定位开关等效于”中断”

 2021-04-27 

phpMyadmin error “continue” targeting switch is equivalent to “break”

安装最新版本的PHP 7.3.4和MySQL Community Server 8.0.15之后,我在phpmyadmin 4.7.7上遇到此错误:

Warning in .\\libraries\\config\\FormDisplay.php#661"continue" targeting
switch is equivalent to"break". Did you mean to use"continue 2"?

Backtrace

.\\vendor\\composer\\ClassLoader.php#444: include()
.\\vendor\\composer\\ClassLoader.php#322:
Composer\\Autoload\\includeFile(string
'F:\\apps\\phpMyAdmin\\vendor\\composer/../../\\libraries\\config\\FormDisplay.php')
Composer\\Autoload\\ClassLoader->loadClass(string
'PMA\\libraries\\config\\FormDisplay')
.\\libraries\\config\\PageSettings.php#76: spl_autoload_call(string
'PMA\\libraries\\config\\FormDisplay')
.\\libraries\\config\\PageSettings.php#230:
PMA\\libraries\\config\\PageSettings->__construct( string 'Navi_panel',
string 'pma_navigation_settings', )
.\\libraries\
avigation\
avigation.php#66:
PMA\\libraries\\config\\PageSettings::getNaviSettings()
.\\libraries\\Header.php#425:
PMA\\libraries\
avigation\
avigation->getDisplay()
.\\libraries\
esponse.php#260: PMA\\libraries\\Header->getDisplay()
.\\libraries\
esponse.php#273: PMA\\libraries\
esponse->_getDisplay()
.\\libraries\
esponse.php#432: PMA\\libraries\
esponse->_htmlResponse()
PMA\\libraries\
esponse->response()

有人知道如何解决此问题吗?


我有相同的内容,并通过编辑php脚本FormDisplay.php对其进行了修复。

在661行上,用break代替continue(保留分号)。

如果您进行编辑,则需要sudo访问权限,但请先备份原始内容。

重新加载页面。希望有帮助。


在文件FormDisplay.php中编辑PHP脚本
在第660行,我在以下路径中找到了此代码

$ /usr/share/phpmyadmin/libraries/config/FormDisplay.php

enter

1
2
3
4
5
6
7
8
9
10
11
case 'select':
     $successfully_validated = $this->_validateSelect(
     $_POST[$key],
     $form->getOptionValueList($system_path)
     );
     if (! $successfully_validated) {
         $this->_errors[$work_path][] = __('Incorrect value!');
         $result = false;
         continue;
    }
    break;

根据以下建议进行更新

1
2
3
4
5
6
7
8
9
10
11
case 'select':
     $successfully_validated = $this->_validateSelect(
     $_POST[$key],
     $form->getOptionValueList($system_path)
     );
     if (! $successfully_validated) {
         $this->_errors[$work_path][] = __('Incorrect value!');
         $result = false;
         break;
    }
    break;

enter