Browse Source

Update functions.php

pull/640/head
danpros 2 years ago
parent
commit
71e2f00fa9
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      system/includes/functions.php

+ 2
- 2
system/includes/functions.php View File

@ -2250,7 +2250,7 @@ function menu($class = null)
$html = parseNodes($nodes, null, $class); $html = parseNodes($nodes, null, $class);
libxml_use_internal_errors(true); libxml_use_internal_errors(true);
$doc = new DOMDocument(); $doc = new DOMDocument();
$doc->loadHTML($html);
$doc->loadHTML('<meta charset="utf8">' . $html);
$finder = new DOMXPath($doc); $finder = new DOMXPath($doc);
$elements = $finder->query("//*[contains(concat(' ', normalize-space(@class), ' '), ' dropdown-menu ')]"); $elements = $finder->query("//*[contains(concat(' ', normalize-space(@class), ' '), ' dropdown-menu ')]");
@ -3334,7 +3334,7 @@ function replace_href($string, $tag, $class, $url)
// Load the HTML in DOM // Load the HTML in DOM
$doc = new DOMDocument(); $doc = new DOMDocument();
$doc->loadHTML($string);
$doc->loadHTML('<meta charset="utf8">' . $string);
// Then select all anchor tags // Then select all anchor tags
$all_anchor_tags = $doc->getElementsByTagName($tag); $all_anchor_tags = $doc->getElementsByTagName($tag);
foreach ($all_anchor_tags as $_tag) { foreach ($all_anchor_tags as $_tag) {


Loading…
Cancel
Save