<?php
/*
	Copyright (c) PORTANEO.

	This file is part of POSH (Portaneo Open Source Homepage) http://sourceforge.net/projects/posh/.

	POSH is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version

	POSH is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with Posh.  If not, see <http://www.gnu.org/licenses/>.
*/
# !! be careful, this file must be saved under uft8 format, and display an e accentuated here : é
/*
    @file xmlvalidrss.php 
*/
//get feed content for first checks

$url = $_REQUEST["url"];
if ($url == "") exit();

require_once('../includes/http.inc.php');
require_once('../includes/misc.inc.php');
require_once('../includes/config.inc.php');
require_once('../includes/feed.inc.php');

$h = new feed($url);
/*
if (__useproxy)
{
    if (isset($_POST["proxy"]))
    {
        $proxy=$_POST["proxy"];
        $pos=strpos($proxy,":");
        $proxyserver=substr($proxy,0,$pos);
        $proxyport=substr($proxy,$pos+1);
    }
    else
    {
        $proxyserver=__PROXYSERVER;
        $proxyport=__PROXYPORT;
    }
    $h->cServer=$proxyserver;
    $h->cPort=$proxyport;
    $h->proxy_auth = "Proxy-Authorization: Basic ".__PROXYCONNECTION."\r\n";
}
*/

if (isset($_REQUEST['auth'])) {
    $h->auth=$_REQUEST["auth"];
    $body = $h->loadAuth();
    //$h->put_authorization("Basic ".$_REQUEST["auth"]);
}
else {
    $body = $h->load(); 
}

$f = new feed('');
$body = $f->transcode($body);

/*
if (!isUTF8($body)) {
    $body = utf8_encode($body);
}
*/

echo $body;
?>