diff --git a/lib/Fred.class.php b/lib/Fred.class.php index d671405..dab3855 100644 --- a/lib/Fred.class.php +++ b/lib/Fred.class.php @@ -46,7 +46,8 @@ class Fred { throw new Exception("J'ai pas pû récupérer la putain de deuxième page."); } - preg_match("`url='([^']+)'`isU", $page2, $matches); + $ClearText = preg_replace( "/\n\s+/", "\n", rtrim(html_entity_decode(strip_tags($page2))) ); + preg_match("`url='([^']+)'`isU", $ClearText, $matches); $ipnsKey = $matches[1]; @@ -148,8 +149,8 @@ class Fred { throw new Exception("J'ai pas pû récupérer la putain de deuxième page."); } - - preg_match("`url='([^']+)'`isU", $page2, $matches); + $ClearText = preg_replace( "/\n\s+/", "\n", rtrim(html_entity_decode(strip_tags($page2))) ); + preg_match("`url='([^']+)'`isU", $ClearText, $matches); $gchangeId = $matches[1];