summaryrefslogtreecommitdiffstats
path: root/wp-includes/bookmark.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2007-05-21 18:37:58 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2007-05-21 18:37:58 +0000
commit89fe0ff804e7c6497ebacc8b341ac89974f6f255 (patch)
tree3fce310b29c685008fdbb75c5ab531bc3a6ae12a /wp-includes/bookmark.php
parenta139071806ba941346a109fbefb2d5f22bae1cc4 (diff)
downloadwordpress-mu-89fe0ff804e7c6497ebacc8b341ac89974f6f255.tar.gz
wordpress-mu-89fe0ff804e7c6497ebacc8b341ac89974f6f255.tar.xz
wordpress-mu-89fe0ff804e7c6497ebacc8b341ac89974f6f255.zip
WP Merge to rev 5499, this is a big one! Test it before you put it live!
Test only, not for production use yet git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@972 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes/bookmark.php')
-rw-r--r--wp-includes/bookmark.php24
1 files changed, 13 insertions, 11 deletions
diff --git a/wp-includes/bookmark.php b/wp-includes/bookmark.php
index 5aea9a8..ad2e696 100644
--- a/wp-includes/bookmark.php
+++ b/wp-includes/bookmark.php
@@ -3,6 +3,7 @@
function get_bookmark($bookmark_id, $output = OBJECT) {
global $wpdb;
+ $bookmark_id = (int) $bookmark_id;
$link = $wpdb->get_row("SELECT * FROM $wpdb->links WHERE link_id = '$bookmark_id'");
$link->link_category = wp_get_link_cats($bookmark_id);
@@ -24,16 +25,17 @@ function get_link($bookmark_id, $output = OBJECT) {
function get_bookmarks($args = '') {
global $wpdb;
-
- if ( is_array($args) )
- $r = &$args;
- else
- parse_str($args, $r);
-
- $defaults = array('orderby' => 'name', 'order' => 'ASC', 'limit' => -1, 'category' => '',
- 'category_name' => '', 'hide_invisible' => 1, 'show_updated' => 0, 'include' => '', 'exclude' => '');
- $r = array_merge($defaults, $r);
- extract($r);
+
+ $defaults = array(
+ 'orderby' => 'name', 'order' => 'ASC',
+ 'limit' => -1, 'category' => '',
+ 'category_name' => '', 'hide_invisible' => 1,
+ 'show_updated' => 0, 'include' => '',
+ 'exclude' => ''
+ );
+
+ $r = wp_parse_args( $args, $defaults );
+ extract( $r );
$key = md5( serialize( $r ) );
if ( $cache = wp_cache_get( 'get_bookmarks', 'bookmark' ) )
@@ -135,7 +137,7 @@ function get_bookmarks($args = '') {
$results = $wpdb->get_results($query);
$cache[ $key ] = $results;
- wp_cache_set( 'get_bookmarks', $cache, 'bookmark' );
+ wp_cache_add( 'get_bookmarks', $cache, 'bookmark' );
return apply_filters('get_bookmarks', $results, $r);
}