SimplePie::set_url_replacements PHP Method

set_url_replacements() public method

Defaults to |a|@href, |area|@href, |blockquote|@cite, |del|@cite, |form|@action, |img|@longdesc, |img|@src, |input|@src, |ins|@cite, |q|@cite
Since: 1.0
public set_url_replacements ( array | null $element_attribute = null )
$element_attribute array | null Element/attribute key/value pairs, null for default
    public function set_url_replacements($element_attribute = null)
    {
        $this->sanitize->set_url_replacements($element_attribute);
    }

Usage Example

Ejemplo n.º 1
0
 $http->userAgentDefault = HumbleHttpAgent::UA_PHP;
 // configure SimplePie HTTP extension class to use our HumbleHttpAgent instance
 SimplePie_HumbleHttpAgent::set_agent($http);
 $feed = new SimplePie();
 // some feeds use the text/html content type - force_feed tells SimplePie to process anyway
 $feed->force_feed(true);
 $feed->set_file_class('SimplePie_HumbleHttpAgent');
 //$feed->set_feed_url($url); // colons appearing in the URL's path get encoded
 $feed->feed_url = $url;
 $feed->set_autodiscovery_level(SIMPLEPIE_LOCATOR_NONE);
 $feed->set_timeout(20);
 $feed->enable_cache(false);
 $feed->set_stupidly_fast(true);
 $feed->enable_order_by_date(false);
 // we don't want to do anything to the feed
 $feed->set_url_replacements(array());
 // initialise the feed
 // the @ suppresses notices which on some servers causes a 500 internal server error
 $result = @$feed->init();
 //$feed->handle_content_type();
 //$feed->get_title();
 if ($result && (!is_array($feed->data) || count($feed->data) == 0)) {
     die('Sorry, no feed items found');
 }
 // from now on, we'll identify ourselves as a browser
 $http->userAgentDefault = HumbleHttpAgent::UA_BROWSER;
 // Enable caching for multiple downloader
 if (class_exists('HttpRequestPool')) {
     $http->method = $http::METHOD_REQUEST_POOL;
 } elseif (function_exists('curl_multi_init')) {
     $http->method = $http::METHOD_CURL_MULTI;
All Usage Examples Of SimplePie::set_url_replacements