[wp-trac] [WordPress Trac] #40495: Check objects before getting it's value

WordPress Trac noreply at wordpress.org
Thu Apr 20 12:48:32 UTC 2017


#40495: Check objects before getting it's value
-----------------------------+-----------------------------
 Reporter:  khushbu.padalia  |      Owner:
     Type:  defect (bug)     |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  Upload           |    Version:
 Severity:  normal           |   Keywords:
  Focuses:                   |
-----------------------------+-----------------------------
 Hi,

 I am working with media upload file and noticed one issue with the
 WordPress core files.

 To upload media from folder,
 I am using '''media_handle_sideload()''' function. But at the time of
 uploading media, I am getting error of non-object for ''$wp_rewrite
 global'' object in post.php file.

 File Path:- \src\wp-includes\post.php file,
 there is function wp_unique_post_slug() exists. In this function, feeds
 have been getting from global object $wp_rewrite.

 For refrerence,
 $feeds = $wp_rewrite->feeds;

 Before getting feeds from global object, it should be checked if object is
 not empty and feeds are there.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/40495>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list