mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-03 16:51:40 +09:00
Fix fatal error when widget code contains invalid XML
This commit is contained in:
parent
7f3f50b851
commit
f0df00a82d
1 changed files with 6 additions and 1 deletions
|
|
@ -273,8 +273,13 @@ class widgetController extends widget
|
|||
*/
|
||||
function transWidget($matches)
|
||||
{
|
||||
$vars = new stdClass;
|
||||
$xml = simplexml_load_string(trim($matches[0]));
|
||||
if ($xml === false)
|
||||
{
|
||||
return '<div>Invalid XML in widget code.</div>';
|
||||
}
|
||||
|
||||
$vars = new stdClass;
|
||||
foreach ($xml->img ? $xml->img->attributes() : $xml->attributes() as $key => $val)
|
||||
{
|
||||
$vars->{$key} = strval($val);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue