mirror of
https://github.com/e107inc/e107.git
synced 2025-08-17 03:54:09 +02:00
RSS validation fixes.
This commit is contained in:
@@ -1955,20 +1955,24 @@ class e_parse extends e_parser
|
||||
* @param boolean $tags [optional]
|
||||
* @return string
|
||||
*/
|
||||
function toRss($text, $tags = FALSE)
|
||||
function toRss($text, $tags = false)
|
||||
{
|
||||
if($tags != TRUE)
|
||||
if($tags != true)
|
||||
{
|
||||
$text = $this -> toHTML($text, TRUE);
|
||||
$text = $this -> toHTML($text, true);
|
||||
$text = strip_tags($text);
|
||||
}
|
||||
|
||||
$text = $this->toEmail($text);
|
||||
$search = array("'", "$", "'", "$"," & ", e_BASE, "href='request.php");
|
||||
$replace = array("'", '$', "'", '$',' & ', SITEURL, "href='".SITEURL."request.php" );
|
||||
$search = array("'", "$", "'", "$", e_BASE, "href='request.php");
|
||||
$replace = array("'", '$', "'", '$', SITEURL, "href='".SITEURL."request.php" );
|
||||
$text = str_replace($search, $replace, $text);
|
||||
|
||||
if($tags == TRUE && ($text))
|
||||
// Fix any left-over '&'
|
||||
$text = str_replace('&', '&', $text); //first revert any previously converted.
|
||||
$text = str_replace('&', '&', $text);
|
||||
|
||||
if($tags == true && ($text))
|
||||
{
|
||||
$text = "<![CDATA[".$text."]]>";
|
||||
}
|
||||
@@ -3451,6 +3455,10 @@ TMPL;
|
||||
echo "<h3>User-input ≫ toEmail(\$text) <small>from DB</small></h3>";
|
||||
print_a($toEmail);
|
||||
|
||||
// toEmail
|
||||
$toRss = $tp->toRss($text);
|
||||
echo "<h3>User-input ≫ toRss(\$text)</h3>";
|
||||
print_a($toRss);
|
||||
|
||||
echo "</div>";
|
||||
|
||||
|
Reference in New Issue
Block a user