[wp-trac] [WordPress Trac] #21159: get_bookmark() errors with non-existent id
WordPress Trac
wp-trac at lists.automattic.com
Wed Jul 4 19:18:23 UTC 2012
#21159: get_bookmark() errors with non-existent id
---------------------------------+-----------------------------
Reporter: Mike Stop Continues | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version:
Severity: normal | Keywords:
---------------------------------+-----------------------------
Using get_bookmark() with a non-existent id produces the following errors:
{{{
Notice: Trying to get property of non-object in
/homepages/43/d372234873/htdocs/mikestopcontinues/wp-includes/bookmark.php
on line 36
Warning: Creating default object from empty value in
/homepages/43/d372234873/htdocs/mikestopcontinues/wp-includes/bookmark.php
on line 36
Notice: Undefined property: stdClass::$link_id in
/homepages/43/d372234873/htdocs/mikestopcontinues/wp-includes/bookmark.php
on line 37
Notice: Undefined property: stdClass::$link_id in
/homepages/43/d372234873/htdocs/mikestopcontinues/wp-includes/bookmark.php
on line 281
}}}
My thought would be to add `if(is_null($_bookmark)) return false;` to line
36 of wp-includes/bookmark.php, though it might be better to
`if(is_null($_bookmark)) { wp_cache_add($bookmark, $_bookmark,
'bookmark'); return $_bookmark;}`
--
Ticket URL: <http://core.trac.wordpress.org/ticket/21159>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list