corrections

This commit is contained in:
Florian Bouillon 2019-02-27 13:54:08 +01:00
parent a0ee078501
commit 246ae7582a

View File

@ -8,7 +8,7 @@ use PDO;
/** /**
* @author Avior <florian.bouillon@delta-wings.net> * @author Avior <florian.bouillon@delta-wings.net>
* @author Clément Fourrier * @author Clément Fourrier
*/ */
class Functions { class Functions {
public static function endsWith($haystack, $needle) { public static function endsWith($haystack, $needle) {
@ -51,13 +51,13 @@ class Functions {
$html = "<html><body>"; $html = "<html><body>";
$html .= $source; $html .= $source;
$html .= "</body></html>"; $html .= "</body></html>";
$tmpDoc->loadHTML($html); $tmpDoc->loadHTML('<?xml encoding="UTF-8">'.$html);
// $tmpDoc->loadHTML('<?xml encoding="UTF-8">'.$html);
// foreach ($tmpDoc->childNodes as $item) /** @var DOMNode $item */
// if ($item->nodeType == XML_PI_NODE) foreach ($tmpDoc->childNodes as $item)
// $tmpDoc->removeChild($item); if ($item->nodeType == XML_PI_NODE)
// $tmpDoc->encoding = 'UTF-8'; $tmpDoc->removeChild($item);
$tmpDoc->encoding = 'UTF-8';
/** @var DOMNode $node */ /** @var DOMNode $node */
foreach($tmpDoc->getElementsByTagName('body')->item(0)->childNodes as $node) { foreach($tmpDoc->getElementsByTagName('body')->item(0)->childNodes as $node) {
@ -67,7 +67,7 @@ class Functions {
} }
public static function loadRoutes() { public static function loadRoutes() {
//recupération du router //recupération du router
$router = Router::getRouter(); $router = Router::getRouter();
$postCharacters = "[a-z0-9-]"; $postCharacters = "[a-z0-9-]";