I am generating a feed using Zend Framework.
When I am setting a link like the one below, I get an error
$feed = new Zend_Feed_Writer_Feed;
$url = "http://www.example.com/search?s=chris|gayle|pics&device=1"
$feed->setLink($url);
I searched through Zend_Uri.php and Http.php, I was not able to figure out the problem.
exception ‘Zend_Feed_Exception’ with message ‘Invalid parameter:
parameter must be a non-empty string and valid URI/IRI’
|is not allowed. Use%7Cinstead.For more info, see http://en.wikipedia.org/wiki/Percent-encoding#Types_of_URI_characters
To encode a url use
urlencode. This will make sure all characters are correctly encoded into a standard URI.http://php.net/manual/en/function.urlencode.php