all repos — blogroll2email @ a7d852dd91303bcf5755614c7ed686629a5a7ec7

fixing flickr url issues where & wasn't decoded from &
Peter Molnar hello@petermolnar.eu
Tue, 08 Dec 2015 11:32:34 +0000
commit

a7d852dd91303bcf5755614c7ed686629a5a7ec7

parent

af7907fed296794fa90baa3244decee6772a3f6b

2 files changed, 9 insertions(+), 3 deletions(-)

jump to
M blogroll2email.phpblogroll2email.php

@@ -31,6 +31,8 @@ // 30 mins is reasonable

const revisit_time = 1800; const schedule = 'blogroll2email'; + private $cachedir = WP_CONTENT_DIR . DIRECTORY_SEPARATOR. 'cache' . DIRECTORY_SEPARATOR. __CLASS__; + /** * thing to run as early as possible */

@@ -47,6 +49,9 @@ // re-enable the links manager

add_filter( 'pre_option_link_manager_enabled', '__return_true' ); // add our own action for the scheduler to call it add_action( static::schedule, array( &$this, 'worker' ) ); + + if (!is_dir($this->cachedir)) + mkdir ($this->cachedir); } /**

@@ -232,14 +237,14 @@ // instead of the way too simple fetch_feed, we'll use SimplePie itself

if ( !class_exists('SimplePie') ) require_once( ABSPATH . WPINC . '/class-simplepie.php' ); - $url = $bookmark->link_rss; + $url = htmlspecialchars_decode($bookmark->link_rss); $last_updated = strtotime( $bookmark->link_updated ); error_log('Fetching: ' . $url ); $feed = new SimplePie(); $feed->set_feed_url( $url ); $feed->set_cache_duration ( static::revisit_time - 10 ); - $feed->set_cache_location( WP_CONTENT_DIR . DIRECTORY_SEPARATOR. 'cache' ); + $feed->set_cache_location( $this->cachedir ); $feed->force_feed(true); // optimization

@@ -341,7 +346,7 @@ require_once ( dirname(__FILE__) . '/lib/php-mf2/Mf2/Parser.php' );

$last_updated = strtotime( $bookmark->link_updated ); - $url = $bookmark->link_url; + $url = htmlspecialchars_decode($bookmark->link_url); //$hash = md5( $url ); // check cache file and skip this step if exists ?
M readme.txtreadme.txt

@@ -49,6 +49,7 @@

= 0.2.2 = *2015-12-03* +* added htmlspecialchars_decode to getting the urls * tested for WordPress 4.4 = 0.2.1 =