[wp-trac] [WordPress Trac] #29204: SimplePie non-static WP_Feed_Cache::create error in fetch_feed()

WordPress Trac noreply at wordpress.org
Thu Apr 9 13:54:22 UTC 2020


#29204: SimplePie non-static WP_Feed_Cache::create error in fetch_feed()
---------------------------------+------------------------------
 Reporter:  useStrict            |       Owner:  SergeyBiryukov
     Type:  defect (bug)         |      Status:  reviewing
 Priority:  normal               |   Milestone:  Awaiting Review
Component:  Feeds                |     Version:  3.8
 Severity:  normal               |  Resolution:
 Keywords:  has-patch 4.7-early  |     Focuses:
---------------------------------+------------------------------

Comment (by stulab):

 this defect is still alive with the last WordPress version.
 I Changed class-wp-feed-cache.php to add static function get_handler
 {{{#!php
 <?php
 /**
          * Create a new SimplePie_Cache object
          *
          * @param string $location URL location (scheme is used to
 determine handler)
          * @param string $filename Unique identifier for cache object
          * @param string $extension 'spi' or 'spc'
          * @return SimplePie_Cache_Base Type of object depends on scheme
 of `$location`
          */
         public static function get_handler($location, $filename,
 $extension)
         {
                 return new WP_Feed_Cache_Transient($location, $filename,
 $extension);
         }

         /**
          * Creates a new SimplePie_Cache object.
          *
          * @since 2.8.0
          *
          * @param string $location  URL location (scheme is used to
 determine handler).
          * @param string $filename  Unique identifier for cache object.
          * @param string $extension 'spi' or 'spc'.
          * @return WP_Feed_Cache_Transient Feed cache handler object that
 uses transients.
          */
         public function create( $location, $filename, $extension ) {
                 return self::get_handler($location, $filename,
 $extension);
                 //return new WP_Feed_Cache_Transient( $location,
 $filename, $extension );
         }
 }}}

 I had also to change SimplePie/Registry.php to stop the use of create
 function.

 I did it today and it works well

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/29204#comment:34>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list