mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-16 11:35:48 +00:00
Use EXTR_SKIP when extracting. For 2.2. See #4468
git-svn-id: http://svn.automattic.com/wordpress/branches/2.2@5714 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
f3612d4293
commit
5d334e880a
@ -82,7 +82,7 @@ function get_nonauthor_user_ids() {
|
||||
function wp_insert_category($catarr) {
|
||||
global $wpdb;
|
||||
|
||||
extract($catarr);
|
||||
extract($catarr, EXTR_SKIP);
|
||||
|
||||
if( trim( $cat_name ) == '' )
|
||||
return 0;
|
||||
@ -297,7 +297,7 @@ function wp_revoke_user($id) {
|
||||
function wp_insert_link($linkdata) {
|
||||
global $wpdb, $current_user;
|
||||
|
||||
extract($linkdata);
|
||||
extract($linkdata, EXTR_SKIP);
|
||||
|
||||
$update = false;
|
||||
|
||||
|
@ -82,7 +82,7 @@ switch($step) {
|
||||
|
||||
<?php
|
||||
$result = wp_install($weblog_title, 'admin', $admin_email, $public);
|
||||
extract($result);
|
||||
extract($result, EXTR_SKIP);
|
||||
?>
|
||||
|
||||
<p><em><?php _e('Finished!'); ?></em></p>
|
||||
|
@ -183,7 +183,7 @@ function wp_list_authors($args = '') {
|
||||
$defaults = array('optioncount' => false, 'exclude_admin' => true, 'show_fullname' => false, 'hide_empty' => true,
|
||||
'feed' => '', 'feed_image' => '');
|
||||
$r = array_merge($defaults, $r);
|
||||
extract($r);
|
||||
extract($r, EXTR_SKIP);
|
||||
|
||||
// TODO: Move select to get_authors().
|
||||
$authors = $wpdb->get_results("SELECT ID, user_nicename from $wpdb->users " . ($exclude_admin ? "WHERE user_login <> 'admin' " : '') . "ORDER BY display_name");
|
||||
|
@ -253,7 +253,7 @@ function _walk_bookmarks($bookmarks, $args = '' ) {
|
||||
$defaults = array('show_updated' => 0, 'show_description' => 0, 'show_images' => 1, 'before' => '<li>',
|
||||
'after' => '</li>', 'between' => "\n");
|
||||
$r = array_merge($defaults, $r);
|
||||
extract($r);
|
||||
extract($r, EXTR_SKIP);
|
||||
|
||||
foreach ( (array) $bookmarks as $bookmark ) {
|
||||
if ( !isset($bookmark->recently_updated) )
|
||||
@ -331,7 +331,7 @@ function wp_list_bookmarks($args = '') {
|
||||
'category_orderby' => 'name', 'category_order' => 'ASC', 'class' => 'linkcat',
|
||||
'category_before' => '<li id="%id" class="%class">', 'category_after' => '</li>');
|
||||
$r = array_merge($defaults, $r);
|
||||
extract($r);
|
||||
extract($r, EXTR_SKIP);
|
||||
|
||||
$output = '';
|
||||
|
||||
|
@ -34,7 +34,7 @@ function get_bookmarks($args = '') {
|
||||
$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);
|
||||
extract($r, EXTR_SKIP);
|
||||
|
||||
$key = md5( serialize( $r ) );
|
||||
if ( $cache = wp_cache_get( 'get_bookmarks', 'bookmark' ) )
|
||||
|
@ -191,7 +191,7 @@ function wp_dropdown_categories($args = '') {
|
||||
$defaults['selected'] = ( is_category() ) ? get_query_var('cat') : 0;
|
||||
$r = array_merge($defaults, $r);
|
||||
$r['include_last_update_time'] = $r['show_last_update'];
|
||||
extract($r);
|
||||
extract($r, EXTR_SKIP);
|
||||
|
||||
$categories = get_categories($r);
|
||||
|
||||
@ -242,7 +242,7 @@ function wp_list_categories($args = '') {
|
||||
$r['pad_counts'] = true;
|
||||
if ( isset($r['show_date']) )
|
||||
$r['include_last_update_time'] = $r['show_date'];
|
||||
extract($r);
|
||||
extract($r, EXTR_SKIP);
|
||||
|
||||
$categories = get_categories($r);
|
||||
|
||||
|
@ -28,7 +28,7 @@ function &get_categories($args = '') {
|
||||
else
|
||||
$r['orderby'] = "cat_" . $r['orderby']; // restricts order by to cat_ID and cat_name fields
|
||||
$r['number'] = (int) $r['number'];
|
||||
extract($r);
|
||||
extract($r, EXTR_SKIP);
|
||||
|
||||
$key = md5( serialize( $r ) );
|
||||
if ( $cache = wp_cache_get( 'get_categories', 'category' ) )
|
||||
|
@ -506,7 +506,7 @@ class Walker_Page extends Walker {
|
||||
function start_el($output, $page, $depth, $current_page, $args) {
|
||||
if ( $depth )
|
||||
$indent = str_repeat("\t", $depth);
|
||||
extract($args);
|
||||
extract($args, EXTR_SKIP);
|
||||
$css_class = 'page_item';
|
||||
$_current_page = get_page( $current_page );
|
||||
if ( $page->ID == $current_page )
|
||||
@ -696,7 +696,7 @@ class WP_Ajax_Response {
|
||||
'data' => '', 'supplemental' => array());
|
||||
|
||||
$r = array_merge($defaults, $r);
|
||||
extract($r);
|
||||
extract($r, EXTR_SKIP);
|
||||
|
||||
if ( is_wp_error($id) ) {
|
||||
$data = $id;
|
||||
|
@ -285,7 +285,7 @@ function comments_template( $file = '/comments.php' ) {
|
||||
|
||||
$req = get_option('require_name_email');
|
||||
$commenter = wp_get_current_commenter();
|
||||
extract($commenter);
|
||||
extract($commenter, EXTR_SKIP);
|
||||
|
||||
// TODO: Use API instead of SELECTs.
|
||||
if ( $user_ID) {
|
||||
|
@ -178,7 +178,7 @@ function sanitize_comment_cookies() {
|
||||
|
||||
function wp_allow_comment($commentdata) {
|
||||
global $wpdb;
|
||||
extract($commentdata);
|
||||
extract($commentdata, EXTR_SKIP);
|
||||
|
||||
// Simple duplicate check
|
||||
$dupe = "SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = '$comment_post_ID' AND ( comment_author = '$comment_author' ";
|
||||
@ -325,7 +325,7 @@ function wp_get_current_commenter() {
|
||||
|
||||
function wp_insert_comment($commentdata) {
|
||||
global $wpdb;
|
||||
extract($commentdata);
|
||||
extract($commentdata, EXTR_SKIP);
|
||||
|
||||
if ( ! isset($comment_author_IP) )
|
||||
$comment_author_IP = preg_replace( '/[^0-9., ]/', '',$_SERVER['REMOTE_ADDR'] );
|
||||
@ -457,7 +457,7 @@ function wp_update_comment($commentarr) {
|
||||
$commentarr = wp_filter_comment( $commentarr );
|
||||
|
||||
// Now extract the merged array.
|
||||
extract($commentarr);
|
||||
extract($commentarr, EXTR_SKIP);
|
||||
|
||||
$comment_content = apply_filters('comment_save_pre', $comment_content);
|
||||
|
||||
@ -517,7 +517,7 @@ function discover_pingback_server_uri($url, $timeout_bytes = 2048) {
|
||||
$x_pingback_str = 'x-pingback: ';
|
||||
$pingback_href_original_pos = 27;
|
||||
|
||||
extract(parse_url($url));
|
||||
extract(parse_url($url), EXTR_SKIP);
|
||||
|
||||
if ( !isset($host) ) // Not an URL. This should never happen.
|
||||
return false;
|
||||
|
@ -322,7 +322,7 @@ function wp_get_archives($args = '') {
|
||||
|
||||
$defaults = array('type' => 'monthly', 'limit' => '', 'format' => 'html', 'before' => '', 'after' => '', 'show_post_count' => false);
|
||||
$r = array_merge($defaults, $r);
|
||||
extract($r);
|
||||
extract($r, EXTR_SKIP);
|
||||
|
||||
if ( '' == $type )
|
||||
$type = 'monthly';
|
||||
|
@ -168,7 +168,7 @@ function wp_mail($to, $subject, $message, $headers = '') {
|
||||
|
||||
$mail = compact('to', 'subject', 'message', 'headers');
|
||||
$mail = apply_filters('wp_mail', $mail);
|
||||
extract($mail);
|
||||
extract($mail, EXTR_SKIP);
|
||||
|
||||
if ( $headers == '' ) {
|
||||
$headers = "MIME-Version: 1.0\n" .
|
||||
|
@ -141,7 +141,7 @@ function wp_link_pages($args = '') {
|
||||
$defaults = array('before' => '<p>' . __('Pages:'), 'after' => '</p>', 'next_or_number' => 'number', 'nextpagelink' => __('Next page'),
|
||||
'previouspagelink' => __('Previous page'), 'pagelink' => '%', 'more_file' => '', 'echo' => 1);
|
||||
$r = array_merge($defaults, $r);
|
||||
extract($r);
|
||||
extract($r, EXTR_SKIP);
|
||||
|
||||
global $id, $page, $numpages, $multipage, $more, $pagenow;
|
||||
if ( $more_file != '' )
|
||||
@ -255,7 +255,7 @@ function wp_dropdown_pages($args = '') {
|
||||
$defaults = array('depth' => 0, 'child_of' => 0, 'selected' => 0, 'echo' => 1,
|
||||
'name' => 'page_id', 'show_option_none' => '');
|
||||
$r = array_merge($defaults, $r);
|
||||
extract($r);
|
||||
extract($r, EXTR_SKIP);
|
||||
|
||||
$pages = get_pages($r);
|
||||
$output = '';
|
||||
|
@ -182,7 +182,7 @@ function get_posts($args) {
|
||||
'orderby' => 'post_date', 'order' => 'DESC', 'include' => '', 'exclude' => '',
|
||||
'meta_key' => '', 'meta_value' =>'', 'post_type' => 'post', 'post_status' => 'publish', 'post_parent' => 0);
|
||||
$r = array_merge($defaults, $r);
|
||||
extract($r);
|
||||
extract($r, EXTR_SKIP);
|
||||
$numberposts = (int) $numberposts;
|
||||
$offset = (int) $offset;
|
||||
$category = (int) $category;
|
||||
@ -490,7 +490,7 @@ function wp_insert_post($postarr = array()) {
|
||||
$postarr = get_object_vars($postarr);
|
||||
|
||||
// export array as variables
|
||||
extract($postarr);
|
||||
extract($postarr, EXTR_SKIP);
|
||||
|
||||
// Are we updating or creating?
|
||||
$update = false;
|
||||
@ -881,7 +881,7 @@ function trackback_url_list($tb_list, $post_id) {
|
||||
$postdata = wp_get_single_post($post_id, ARRAY_A);
|
||||
|
||||
// import postdata as variables
|
||||
extract($postdata);
|
||||
extract($postdata, EXTR_SKIP);
|
||||
|
||||
// form an excerpt
|
||||
$excerpt = strip_tags($post_excerpt?$post_excerpt:$post_content);
|
||||
@ -1067,7 +1067,7 @@ function &get_pages($args = '') {
|
||||
$defaults = array('child_of' => 0, 'sort_order' => 'ASC', 'sort_column' => 'post_title',
|
||||
'hierarchical' => 1, 'exclude' => '', 'include' => '', 'meta_key' => '', 'meta_value' => '', 'authors' => '');
|
||||
$r = array_merge($defaults, $r);
|
||||
extract($r);
|
||||
extract($r, EXTR_SKIP);
|
||||
|
||||
$key = md5( serialize( $r ) );
|
||||
if ( $cache = wp_cache_get( 'get_pages', 'page' ) )
|
||||
@ -1221,7 +1221,7 @@ function wp_insert_attachment($object, $file = false, $post_parent = 0) {
|
||||
$object = get_object_vars($object);
|
||||
|
||||
// Export array as variables
|
||||
extract($object);
|
||||
extract($object, EXTR_SKIP);
|
||||
|
||||
// Get the basics.
|
||||
$post_content = apply_filters('content_save_pre', $post_content);
|
||||
|
@ -32,7 +32,7 @@ function validate_username( $username ) {
|
||||
function wp_insert_user($userdata) {
|
||||
global $wpdb;
|
||||
|
||||
extract($userdata);
|
||||
extract($userdata, EXTR_SKIP);
|
||||
|
||||
// Are we updating or creating?
|
||||
if ( !empty($ID) ) {
|
||||
|
@ -389,7 +389,7 @@ function wp_widget_pages_control() {
|
||||
|
||||
function wp_widget_links($args) {
|
||||
global $wp_db_version;
|
||||
extract($args);
|
||||
extract($args, EXTR_SKIP);
|
||||
if ( $wp_db_version < 3582 ) {
|
||||
// This ONLY works with li/h2 sidebars.
|
||||
get_links_list();
|
||||
@ -805,7 +805,7 @@ function wp_widget_recent_comments_register() {
|
||||
|
||||
function wp_widget_rss($args, $number = 1) {
|
||||
require_once(ABSPATH . WPINC . '/rss.php');
|
||||
extract($args);
|
||||
extract($args, EXTR_SKIP);
|
||||
$options = get_option('widget_rss');
|
||||
if ( isset($options['error']) && $options['error'] )
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user