Permalink
Browse files

Also fallback if CDATA is empty

Fixes #1364.
  • Loading branch information...
Bloke committed Dec 6, 2018
1 parent 8fc644c commit bd0797c569d0c0b7c2d54eeb60b6691b356acb39
Showing with 10 additions and 14 deletions.
  1. +10 −14 textpattern/vendors/Textpattern/Module/Help/HelpAdmin.php
@@ -137,29 +137,25 @@ public static function pophelp($string = '')
}
$x = $xml ? $xml->xpath("//item[@id='{$item}']") : array();
$pophelp = $x ? trim($x[0]) : false;
if (!$x && !empty(self::$fallback_xml)) {
if (!$pophelp && !empty(self::$fallback_xml)) {
$xml = self::$fallback_xml;
$x = $xml ? $xml->xpath("//item[@id='{$item}']") : array();
$pophelp = $x ? trim($x[0]) : false;
}
$title = '';
if ($x) {
$pophelp = trim($x[0]);
if ($pophelp) {
$title = txpspecialchars($x[0]->attributes()->title);
$format = $x[0]->attributes()->format;
if ($pophelp) {
$title = txpspecialchars($x[0]->attributes()->title);
$format = $x[0]->attributes()->format;
if ($format == 'textile') {
$textile = new \Netcarver\Textile\Parser();
$out = $textile->parse($pophelp).n;
} else {
$out = $pophelp.n;
}
if ($format == 'textile') {
$textile = new \Netcarver\Textile\Parser();
$out = $textile->parse($pophelp).n;
} else {
$out = gTxt('pophelp_missing', array('{item}' => $item));
$out = $pophelp.n;
}
} else {
$out = gTxt('pophelp_missing', array('{item}' => $item));

0 comments on commit bd0797c

Please sign in to comment.