我安裝了一個腳本,當我登錄到管理儀表板正在此錯誤:XML文件加載錯誤
Warning (2): simplexml_load_file(): /app/Plugin/PaypalAdaptive/info.xml:7: parser error : xmlParseEntityRef: no name [APP/Controller/PluginsController.php, line 1151]
我檢查的文件pluginscontroller.php
這是代碼。我從整個文件的一部分複製。
線1151是:$xml = simplexml_load_file($file);
的完整代碼從這裏開始:
// get all installed plugins
$plugins = $this->Plugin->find('all', array(
'order' => 'id DESC'
));
$totalNewVersion = 0;
if($plugins != null)
{
foreach($plugins as $k => $plugin)
{
$plugin = $plugin['Plugin'];
$file = sprintf(PLUGIN_INFO_PATH, $plugin['key']);
if(file_exists($file))
{
$xml = simplexml_load_file($file);
if($xml != null && isset($xml->version))
{
if((string)$xml->version > $plugin['version'])
{
$totalNewVersion += 1;
}
}
}
}
}
return $totalNewVersion;
}
public function admin_do_upgrade($id)
{
if(!$this->Plugin->hasAny(array('id' => $id)))
{
$this->Session->setFlash(__('This plugin does not exist'), 'default', array('class' => 'Metronic-alerts alert alert-danger fade in'));
}
else
{
請在顯示讀取時顯示生成此錯誤的最小XML文件。 –
在將xml加載到php文件時可能出現['xmlParseEntityRef:no name'警告]的副本(http://stackoverflow.com/questions/7604436/ xmlparseentityref-no-name-warnings-while-loading-xml-into-a-php-file) – Devon