diff --git a/0.3/index.php b/0.3/index.php index 03a6837..ba2fa56 100755 --- a/0.3/index.php +++ b/0.3/index.php @@ -37,15 +37,10 @@ function get_link_from_feed($url) // get site link from feed $data = file_get_contents("$url"); $xml = simplexml_load_string($data); // quick feed check - if (isset($xml->entry)) // ATOM feed. - {$result="true";} - elseif (isset($xml->item)) // RSS 1.0 /RDF - {$result="true";} - elseif (isset($xml->channel->item)) // RSS 2.0 - {$result="true";} - else - {$result="false";} - if($result == "false") { die('le flux n\'a pas une syntaxe valide'); } + // ATOM feed && RSS 1.0 /RDF && RSS 2.0 + if (!isset($xml->entry) && !isset($xml->item) && !isset($xml->channel->item)) + { die('le flux n\'a pas une syntaxe valide'); } + $check = substr($data, 0, 5); if($check !== ''. $sitename .'" +SITE_DESCRIPTION="source: '. $sitename .'" SITE_URL="'. $siteurl .'" FEED_URL="'. $rssurl .'" ARTICLES_PER_PAGE="5" @@ -299,7 +294,7 @@ if( empty($error) ) { if( !fwrite($fp, '[VroumVroumBlogConfig] SITE_TYPE="'.$sitetype.'" SITE_TITLE="'.$socialinstance.'-'.$socialaccount.'" -SITE_DESCRIPTION="source: '. $socialaccount .'" +SITE_DESCRIPTION="source: '. $socialaccount .'" SITE_URL="'. $siteurl .'" FEED_URL="'. $rssurl .'" ARTICLES_PER_PAGE="20" @@ -346,7 +341,7 @@ if( !empty($_POST) && empty($_POST['socialinstance']) && $allow_new_autoblogs = if( !fwrite($fp, '[VroumVroumBlogConfig] SITE_TYPE="generic" SITE_TITLE="'. $sitename .'" -SITE_DESCRIPTION="source: '. $sitename .'" +SITE_DESCRIPTION="source: '. $sitename .'" SITE_URL="'. $siteurl .'" FEED_URL="'. $rssurl .'" ARTICLES_PER_PAGE="5"