[wp-trac] [WordPress Trac] #50159: Simplepie 1.5.5 - code review and modifications - fix SimplePie cache bug (was: Simplepie 1.5.5 - code review and modifications)
WordPress Trac
noreply at wordpress.org
Thu May 14 07:44:41 UTC 2020
#50159: Simplepie 1.5.5 - code review and modifications - fix SimplePie cache bug
--------------------------+------------------------------
Reporter: arena | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Feeds | Version: trunk
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
--------------------------+------------------------------
Comment (by arena):
@afragen
i am sorry but your code as shown in
https://github.com/afragen/wordpress-beta-
tester/blob/develop/src/WPBT/WPBT_Beta_RC.php#L520-L522
do not match with simplepie cache current code
your code (note that you "md5" the feed url) :
{{{#!php
$transient = md5( 'https://wordpress.org/news/category/development/feed/'
);
delete_transient( "feed_{$transient}" );
delete_transient( "feed_mod_{$transient}" );
}}}
current wordpress code in wordpress extended simplepie cache class in wp-
includes/class-wp-feed-cache-transient.php is (filename being the url
feed)
{{{#!php
$this->name = 'feed_' . $filename;
$this->mod_name = 'feed_mod_' . $filename;
}}}
so your code is not working (current simplepie cache code either)!
if you want to adapt your code to the patch, here is some hints :
* simplepie manage two kind of extensions : 'spc' and 'spi' for
respectively 'Feed cache type' and 'Image cache type' (see wp-
includes\SimplePie\Cache\Base.php)
* here is what your code should be when patch will apply
{{{#!php
$transient = md5(
'https://wordpress.org/news/category/development/feed/:spc' );
delete_transient( "feed_{$transient}" );
delete_transient( "feed_mod_{$transient}" );
}}}
Regards.
Have a nice day.
btw : if any unit-tests within github, it looks like they are not relevant
!
--
Ticket URL: <https://core.trac.wordpress.org/ticket/50159#comment:21>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list