forked from blallo/rss-bridge
[formats] Remove all unnecessary code comments
This commit is contained in:
parent
059b099436
commit
1e9b5c8611
3 changed files with 3 additions and 32 deletions
|
@ -6,7 +6,6 @@
|
||||||
class AtomFormat extends FormatAbstract{
|
class AtomFormat extends FormatAbstract{
|
||||||
|
|
||||||
public function stringify(){
|
public function stringify(){
|
||||||
/* Datas preparation */
|
|
||||||
$https = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 's' : '';
|
$https = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 's' : '';
|
||||||
$httpHost = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '';
|
$httpHost = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '';
|
||||||
$httpInfo = isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : '';
|
$httpInfo = isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : '';
|
||||||
|
@ -42,16 +41,7 @@ class AtomFormat extends FormatAbstract{
|
||||||
EOD;
|
EOD;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
$feedTimestamp = date(DATE_ATOM, time());
|
||||||
TODO :
|
|
||||||
- Security: Disable Javascript ?
|
|
||||||
- <updated> : Define new extra info ?
|
|
||||||
- <content type="html"> : RFC look with xhtml, keep this in spite of ?
|
|
||||||
*/
|
|
||||||
|
|
||||||
// #### TEMPORARY FIX ###
|
|
||||||
$feedTimestamp = date(DATE_ATOM, time());
|
|
||||||
// ################
|
|
||||||
|
|
||||||
/* Data are prepared, now let's begin the "MAGIE !!!" */
|
/* Data are prepared, now let's begin the "MAGIE !!!" */
|
||||||
$toReturn = '<?xml version="1.0" encoding="UTF-8"?>';
|
$toReturn = '<?xml version="1.0" encoding="UTF-8"?>';
|
||||||
|
@ -70,11 +60,6 @@ $feedTimestamp = date(DATE_ATOM, time());
|
||||||
EOD;
|
EOD;
|
||||||
|
|
||||||
// Remove invalid non-UTF8 characters
|
// Remove invalid non-UTF8 characters
|
||||||
|
|
||||||
// We cannot use iconv because of a bug in some versions of iconv.
|
|
||||||
// See http://www.php.net/manual/fr/function.iconv.php#108643
|
|
||||||
//$toReturn = iconv("UTF-8", "UTF-8//IGNORE", $toReturn);
|
|
||||||
// So we use mb_convert_encoding instead:
|
|
||||||
ini_set('mbstring.substitute_character', 'none');
|
ini_set('mbstring.substitute_character', 'none');
|
||||||
$toReturn= mb_convert_encoding($toReturn, 'UTF-8', 'UTF-8');
|
$toReturn= mb_convert_encoding($toReturn, 'UTF-8', 'UTF-8');
|
||||||
return $toReturn;
|
return $toReturn;
|
||||||
|
@ -82,7 +67,7 @@ EOD;
|
||||||
|
|
||||||
public function display(){
|
public function display(){
|
||||||
$this
|
$this
|
||||||
->setContentType('application/atom+xml; charset=UTF-8') // We force UTF-8 in ATOM output.
|
->setContentType('application/atom+xml; charset=UTF-8')
|
||||||
->callContentType();
|
->callContentType();
|
||||||
|
|
||||||
return parent::display();
|
return parent::display();
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
class HtmlFormat extends FormatAbstract{
|
class HtmlFormat extends FormatAbstract{
|
||||||
|
|
||||||
public function stringify(){
|
public function stringify(){
|
||||||
/* Datas preparation */
|
|
||||||
$extraInfos = $this->getExtraInfos();
|
$extraInfos = $this->getExtraInfos();
|
||||||
$title = htmlspecialchars($extraInfos['name']);
|
$title = htmlspecialchars($extraInfos['name']);
|
||||||
$uri = htmlspecialchars($extraInfos['uri']);
|
$uri = htmlspecialchars($extraInfos['uri']);
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
class MrssFormat extends FormatAbstract{
|
class MrssFormat extends FormatAbstract{
|
||||||
|
|
||||||
public function stringify(){
|
public function stringify(){
|
||||||
/* Datas preparation */
|
|
||||||
$https = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 's' : '';
|
$https = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 's' : '';
|
||||||
$httpHost = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '';
|
$httpHost = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '';
|
||||||
$httpInfo = isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : '';
|
$httpInfo = isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : '';
|
||||||
|
@ -38,13 +37,6 @@ class MrssFormat extends FormatAbstract{
|
||||||
EOD;
|
EOD;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
TODO :
|
|
||||||
- Security: Disable Javascript ?
|
|
||||||
- <updated> : Define new extra info ?
|
|
||||||
- <content type="html"> : RFC look with xhtml, keep this in spite of ?
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Data are prepared, now let's begin the "MAGIE !!!" */
|
/* Data are prepared, now let's begin the "MAGIE !!!" */
|
||||||
$toReturn = '<?xml version="1.0" encoding="UTF-8"?>';
|
$toReturn = '<?xml version="1.0" encoding="UTF-8"?>';
|
||||||
$toReturn .= <<<EOD
|
$toReturn .= <<<EOD
|
||||||
|
@ -61,11 +53,6 @@ EOD;
|
||||||
EOD;
|
EOD;
|
||||||
|
|
||||||
// Remove invalid non-UTF8 characters
|
// Remove invalid non-UTF8 characters
|
||||||
|
|
||||||
// We cannot use iconv because of a bug in some versions of iconv.
|
|
||||||
// See http://www.php.net/manual/fr/function.iconv.php#108643
|
|
||||||
//$toReturn = iconv("UTF-8", "UTF-8//IGNORE", $toReturn);
|
|
||||||
// So we use mb_convert_encoding instead:
|
|
||||||
ini_set('mbstring.substitute_character', 'none');
|
ini_set('mbstring.substitute_character', 'none');
|
||||||
$toReturn= mb_convert_encoding($toReturn, 'UTF-8', 'UTF-8');
|
$toReturn= mb_convert_encoding($toReturn, 'UTF-8', 'UTF-8');
|
||||||
return $toReturn;
|
return $toReturn;
|
||||||
|
@ -73,7 +60,7 @@ EOD;
|
||||||
|
|
||||||
public function display(){
|
public function display(){
|
||||||
$this
|
$this
|
||||||
->setContentType('application/rss+xml; charset=UTF-8') // We force UTF-8 in RSS output.
|
->setContentType('application/rss+xml; charset=UTF-8')
|
||||||
->callContentType();
|
->callContentType();
|
||||||
|
|
||||||
return parent::display();
|
return parent::display();
|
||||||
|
|
Loading…
Reference in a new issue