WordPress.org

Ready to get started?Download WordPress

Forums

RSS Cloud
Bug Report: should add "http://" to $notify_url (1 post)

  1. gnarvaja
    Member
    Posted 3 years ago #

    Some subscriptions fail because the url parameter sent to "wp_remote_get" or "wp_remote_post" doesn't starts with "http://".

    This is the change I suggest:

    --- notification-request.php.old	2011-01-03 19:12:09.000000000 -0300
    +++ notification-request.php	2011-01-03 19:36:12.000000000 -0300
    @@ -34,10 +34,12 @@
     	if ( defined( 'RSSCLOUD_FEED_URL' ) )
     		$rss2_url = RSSCLOUD_FEED_URL;
    
    -	$notify_url = $_SERVER['REMOTE_ADDR'] . ':' . $port . $path;
    +	$notify_url = 'http://' . $_SERVER['REMOTE_ADDR'] . ':' . $port . $path;
    
     	if ( !empty( $_POST['domain'] ) ) {
     		$domain = str_replace( '@', '', $_POST['domain'] );
    +		if ( strpos($domain, "http://") !== 0 )
    +			$domain = "http://" . $domain;
     		$notify_url = $domain . ':' . $port . $path;
    
     		$challenge = rsscloud_generate_challenge( );

    I think maybe with certain versions of PHP and/or WordPress, calls to wp_remote_get without "http://" doesn't fail, but in my environment (PHP 5.2.13 / WordPress 2.8.2) they do.

    I left backward compatibility with domain parameters already starting with "http://".

    In http://codex.wordpress.org/Function_API/wp_remote_get you can see that wp_remote_get should receive an URL and examples use "http://..."

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags