1
0
Fork 0
forked from blallo/rss-bridge

[formats] Remove all unnecessary code comments

This commit is contained in:
logmanoriginal 2016-08-29 19:24:31 +02:00
parent 059b099436
commit 1e9b5c8611
3 changed files with 3 additions and 32 deletions

View file

@ -6,7 +6,6 @@
class AtomFormat extends FormatAbstract{
public function stringify(){
/* Datas preparation */
$https = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 's' : '';
$httpHost = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '';
$httpInfo = isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : '';
@ -42,16 +41,7 @@ class AtomFormat extends FormatAbstract{
EOD;
}
/*
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 !!!" */
$toReturn = '<?xml version="1.0" encoding="UTF-8"?>';
@ -70,11 +60,6 @@ $feedTimestamp = date(DATE_ATOM, time());
EOD;
// 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');
$toReturn= mb_convert_encoding($toReturn, 'UTF-8', 'UTF-8');
return $toReturn;
@ -82,7 +67,7 @@ EOD;
public function display(){
$this
->setContentType('application/atom+xml; charset=UTF-8') // We force UTF-8 in ATOM output.
->setContentType('application/atom+xml; charset=UTF-8')
->callContentType();
return parent::display();

View file

@ -2,7 +2,6 @@
class HtmlFormat extends FormatAbstract{
public function stringify(){
/* Datas preparation */
$extraInfos = $this->getExtraInfos();
$title = htmlspecialchars($extraInfos['name']);
$uri = htmlspecialchars($extraInfos['uri']);

View file

@ -6,7 +6,6 @@
class MrssFormat extends FormatAbstract{
public function stringify(){
/* Datas preparation */
$https = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 's' : '';
$httpHost = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '';
$httpInfo = isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : '';
@ -38,13 +37,6 @@ class MrssFormat extends FormatAbstract{
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 !!!" */
$toReturn = '<?xml version="1.0" encoding="UTF-8"?>';
$toReturn .= <<<EOD
@ -61,11 +53,6 @@ EOD;
EOD;
// 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');
$toReturn= mb_convert_encoding($toReturn, 'UTF-8', 'UTF-8');
return $toReturn;
@ -73,7 +60,7 @@ EOD;
public function display(){
$this
->setContentType('application/rss+xml; charset=UTF-8') // We force UTF-8 in RSS output.
->setContentType('application/rss+xml; charset=UTF-8')
->callContentType();
return parent::display();