From 618242be0859900f490a1a3e5087bbd713602d05 Mon Sep 17 00:00:00 2001 From: rylon Date: Wed, 15 Apr 2015 19:29:00 +0200 Subject: [PATCH] fixed problem with default page dom validation --- api/api_default.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/api/api_default.php b/api/api_default.php index f104246..aa80631 100644 --- a/api/api_default.php +++ b/api/api_default.php @@ -6,20 +6,23 @@ abstract class api_default extends api_system { //https://developers.google.com/webmasters/ajax-crawling/docs/getting-started //mojotrollz.eu:80/web/flingit/?_escaped_fragment_=start%3Bhash.ce5504f67533ab3d881a32e1dcdd330aaeb27f19 public static function static__escaped_fragment_($_escaped_fragment_){ + \libxml_use_internal_errors(true); $html = new \DOMDocument(); $html->loadHTML(static::default_page($_escaped_fragment_)); + if($error = \libxml_get_last_error()){ + new \SYSTEM\LOG\ERROR('Parse Error: '.$error->message.' line:'.$error->line.' html: '.$html->saveHTML()); + \libxml_clear_errors();} $state = \SYSTEM\PAGE\State::get(static::get_apigroup(), $_escaped_fragment_,false); foreach($state as $row){ $frag = new \DOMDocument(); parse_str(\parse_url($row['url'],PHP_URL_QUERY), $params); $class = static::get_class($params); if($class){ - \libxml_use_internal_errors(true); - $frag->loadHTML(\SYSTEM\API\api::run('\SYSTEM\API\verify', $class, static::get_params($params), static::get_apigroup(), true, false)); - $html->getElementById(substr($row['div'], 1))->appendChild($html->importNode($frag->documentElement, true)); + $frag->loadHTML(\SYSTEM\API\api::run('\SYSTEM\API\verify', $class, static::get_params($params), static::get_apigroup(), true, false)); if($error = \libxml_get_last_error()){ - new \SYSTEM\LOG\ERROR('Parse Error: '.$error->message.' line:'.$error->line.' html: '.$html->saveHTML());} - \libxml_clear_errors(); + new \SYSTEM\LOG\ERROR('Parse Error: '.$error->message.' line:'.$error->line.' html: '.$frag->saveHTML()); + \libxml_clear_errors();} + $html->getElementById(substr($row['div'], 1))->appendChild($html->importNode($frag->documentElement, true)); //Load subpage css foreach($row['css'] as $css){ $css_frag = new \DOMDocument();