Ticket #2888: wp_reset_vars.diff
| File wp_reset_vars.diff, 15.2 KB (added by , 20 years ago) |
|---|
-
Sewar/WordPress/SVN/wp-admin/admin-functions.php
1953 1953 return array((int) ($width / $height * 96), 96); 1954 1954 } 1955 1955 1956 function wp_reset_vars($vars) { 1957 for ($i=0; $i<count($vars); $i += 1) { 1958 $var = $vars[$i]; 1959 global $$var; 1960 1961 if (!isset($$var)) { 1962 if (empty($_REQUEST["$var"])) { 1963 $$var = ''; 1964 } else { 1965 $$var = $_REQUEST["$var"]; 1966 unset($_REQUEST["$wpvar"]); 1967 } 1968 } 1969 } 1970 } 1971 1956 1972 ?> -
Sewar/WordPress/SVN/wp-admin/admin.php
24 24 $date_format = get_settings('date_format'); 25 25 $time_format = get_settings('time_format'); 26 26 27 $wpvarstoreset = array('profile','redirect','redirect_url','a','popuptitle','popupurl','text', 'trackback', 'pingback'); 28 for ($i=0; $i<count($wpvarstoreset); $i += 1) { 29 $wpvar = $wpvarstoreset[$i]; 30 if (!isset($$wpvar)) { 31 if (empty($_POST["$wpvar"])) { 32 if (empty($_GET["$wpvar"])) { 33 $$wpvar = ''; 34 } else { 35 $$wpvar = $_GET["$wpvar"]; 36 } 37 } else { 38 $$wpvar = $_POST["$wpvar"]; 39 } 40 } 41 } 27 wp_reset_vars(array('profile', 'redirect', 'redirect_url', 'a', 'popuptitle', 'popupurl', 'text', 'trackback', 'pingback')); 42 28 43 29 wp_enqueue_script( 'fat' ); 44 30 -
Sewar/WordPress/SVN/wp-admin/categories.php
4 4 $title = __('Categories'); 5 5 $parent_file = 'edit.php'; 6 6 7 $wpvarstoreset = array('action','cat'); 8 for ($i=0; $i<count($wpvarstoreset); $i += 1) { 9 $wpvar = $wpvarstoreset[$i]; 10 if (!isset($$wpvar)) { 11 if (empty($_POST["$wpvar"])) { 12 if (empty($_GET["$wpvar"])) { 13 $$wpvar = ''; 14 } else { 15 $$wpvar = $_GET["$wpvar"]; 16 } 17 } else { 18 $$wpvar = $_POST["$wpvar"]; 19 } 20 } 21 } 7 wp_reset_vars(array('action', 'cat')); 22 8 23 9 switch($action) { 24 10 -
Sewar/WordPress/SVN/wp-admin/comment.php
3 3 4 4 $parent_file = 'edit.php'; 5 5 $submenu_file = 'edit-comments.php'; 6 $wpvarstoreset = array('action');7 6 8 for ($i=0; $i<count($wpvarstoreset); $i += 1) { 9 $wpvar = $wpvarstoreset[$i]; 10 if (!isset($$wpvar)) { 11 if (empty($_POST["$wpvar"])) { 12 if (empty($_GET["$wpvar"])) { 13 $$wpvar = ''; 14 } else { 15 $$wpvar = $_GET["$wpvar"]; 16 } 17 } else { 18 $$wpvar = $_POST["$wpvar"]; 19 } 20 } 21 } 7 wp_reset_vars(array('action')); 22 8 23 9 if ( isset( $_POST['deletecomment'] ) ) 24 10 $action = 'deletecomment'; -
Sewar/WordPress/SVN/wp-admin/inline-uploading.php
7 7 if (!current_user_can('upload_files')) 8 8 die(__('You do not have permission to upload files.')); 9 9 10 $wpvarstoreset = array('action', 'post', 'all', 'last', 'link', 'sort', 'start', 'imgtitle', 'descr', 'attachment');10 wp_reset_vars(array('action', 'post', 'all', 'last', 'link', 'sort', 'start', 'imgtitle', 'descr', 'attachment')); 11 11 12 for ($i=0; $i<count($wpvarstoreset); $i += 1) {13 $wpvar = $wpvarstoreset[$i];14 if (!isset($$wpvar)) {15 if (empty($_POST["$wpvar"])) {16 if (empty($_GET["$wpvar"])) {17 $$wpvar = '';18 } else {19 $$wpvar = $_GET["$wpvar"];20 }21 } else {22 $$wpvar = $_POST["$wpvar"];23 }24 }25 }26 27 12 $post = (int) $post; 28 13 $images_width = 1; 29 14 -
Sewar/WordPress/SVN/wp-admin/link-add.php
6 6 $parent_file = 'link-manager.php'; 7 7 8 8 9 $wpvarstoreset =array('action', 'cat_id', 'linkurl', 'name', 'image',9 wp_reset_vars(array('action', 'cat_id', 'linkurl', 'name', 'image', 10 10 'description', 'visible', 'target', 'category', 'link_id', 11 11 'submit', 'order_by', 'links_show_cat_id', 'rating', 'rel', 12 'notes', 'linkcheck[]'); 13 for ($i=0; $i<count($wpvarstoreset); $i += 1) { 14 $wpvar = $wpvarstoreset[$i]; 15 if (!isset($$wpvar)) { 16 if (empty($_POST["$wpvar"])) { 17 if (empty($_GET["$wpvar"])) { 18 $$wpvar = ''; 19 } else { 20 $$wpvar = $_GET["$wpvar"]; 21 } 22 } else { 23 $$wpvar = $_POST["$wpvar"]; 24 } 25 } 26 } 12 'notes', 'linkcheck[]')); 27 13 28 14 wp_enqueue_script( array('xfn', 'dbx-admin-key?pagenow=link.php') ); 29 15 if ( current_user_can( 'manage_categories' ) ) -
Sewar/WordPress/SVN/wp-admin/link-manager.php
10 10 $this_file = $parent_file = 'link-manager.php'; 11 11 wp_enqueue_script( 'listman' ); 12 12 13 $wpvarstoreset = array ('action', 'cat_id', 'linkurl', 'name', 'image', 'description', 'visible', 'target', 'category', 'link_id', 'submit', 'order_by', 'links_show_cat_id', 'rating', 'rel', 'notes', 'linkcheck[]');13 wp_reset_vars(array('action', 'cat_id', 'linkurl', 'name', 'image', 'description', 'visible', 'target', 'category', 'link_id', 'submit', 'order_by', 'links_show_cat_id', 'rating', 'rel', 'notes', 'linkcheck[]')); 14 14 15 for ($i = 0; $i < count($wpvarstoreset); $i += 1) {16 $wpvar = $wpvarstoreset[$i];17 if (!isset ($$wpvar)) {18 if (empty ($_POST["$wpvar"])) {19 if (empty ($_GET["$wpvar"])) {20 $$wpvar = '';21 } else {22 $$wpvar = $_GET["$wpvar"];23 }24 } else {25 $$wpvar = $_POST["$wpvar"];26 }27 }28 }29 30 15 if (empty ($cat_id)) 31 16 $cat_id = 'all'; 32 17 -
Sewar/WordPress/SVN/wp-admin/link.php
1 1 <?php 2 2 require_once ('admin.php'); 3 3 4 $wpvarstoreset = array ('action', 'cat_id', 'linkurl', 'name', 'image', 'description', 'visible', 'target', 'category', 'link_id', 'submit', 'order_by', 'links_show_cat_id', 'rating', 'rel', 'notes', 'linkcheck[]');4 wp_reset_vars(array('action', 'cat_id', 'linkurl', 'name', 'image', 'description', 'visible', 'target', 'category', 'link_id', 'submit', 'order_by', 'links_show_cat_id', 'rating', 'rel', 'notes', 'linkcheck[]')); 5 5 6 for ($i = 0; $i < count($wpvarstoreset); $i += 1) {7 $wpvar = $wpvarstoreset[$i];8 if (!isset ($$wpvar)) {9 if (empty ($_POST["$wpvar"])) {10 if (empty ($_GET["$wpvar"])) {11 $$wpvar = '';12 } else {13 $$wpvar = $_GET["$wpvar"];14 }15 } else {16 $$wpvar = $_POST["$wpvar"];17 }18 }19 }20 21 6 if ('' != $_POST['deletebookmarks']) 22 7 $action = 'deletebookmarks'; 23 8 if ('' != $_POST['move']) -
Sewar/WordPress/SVN/wp-admin/moderation.php
5 5 $parent_file = 'edit.php'; 6 6 wp_enqueue_script( 'admin-comments' ); 7 7 8 $wpvarstoreset = array('action', 'item_ignored', 'item_deleted', 'item_approved', 'item_spam', 'feelinglucky'); 9 for ($i=0; $i<count($wpvarstoreset); $i += 1) { 10 $wpvar = $wpvarstoreset[$i]; 11 if (!isset($$wpvar)) { 12 if (empty($_POST["$wpvar"])) { 13 if (empty($_GET["$wpvar"])) { 14 $$wpvar = ''; 15 } else { 16 $$wpvar = $_GET["$wpvar"]; 17 } 18 } else { 19 $$wpvar = $_POST["$wpvar"]; 20 } 21 } 22 } 8 wp_reset_vars(array('action', 'item_ignored', 'item_deleted', 'item_approved', 'item_spam', 'feelinglucky')); 23 9 24 10 $comment = array(); 25 11 if (isset($_POST["comment"])) { -
Sewar/WordPress/SVN/wp-admin/options-head.php
1 <?php 1 <?php wp_reset_vars(array('action', 'standalone', 'option_group_id')); ?> 2 2 3 $wpvarstoreset = array('action','standalone', 'option_group_id');4 for ($i=0; $i<count($wpvarstoreset); $i += 1) {5 $wpvar = $wpvarstoreset[$i];6 if (!isset($$wpvar)) {7 if (empty($_POST["$wpvar"])) {8 if (empty($_GET["$wpvar"])) {9 $$wpvar = '';10 } else {11 $$wpvar = $_GET["$wpvar"];12 }13 } else {14 $$wpvar = $_POST["$wpvar"];15 }16 }17 }18 ?>19 20 3 <br clear="all" /> 21 4 22 5 <?php if (isset($_GET['updated'])) : ?> -
Sewar/WordPress/SVN/wp-admin/options.php
5 5 $this_file = 'options.php'; 6 6 $parent_file = 'options-general.php'; 7 7 8 $wpvarstoreset = array('action'); 9 for ($i=0; $i<count($wpvarstoreset); $i += 1) { 10 $wpvar = $wpvarstoreset[$i]; 11 if (!isset($$wpvar)) { 12 if (empty($_POST["$wpvar"])) { 13 if (empty($_GET["$wpvar"])) { 14 $$wpvar = ''; 15 } else { 16 $$wpvar = $_GET["$wpvar"]; 17 } 18 } else { 19 $$wpvar = $_POST["$wpvar"]; 20 } 21 } 22 } 8 wp_reset_vars(array('action')); 23 9 24 10 if ( !current_user_can('manage_options') ) 25 11 die ( __('Cheatin’ uh?') ); -
Sewar/WordPress/SVN/wp-admin/page.php
3 3 4 4 $parent_file = 'edit.php'; 5 5 $submenu_file = 'edit-pages.php'; 6 $wpvarstoreset = array('action');7 6 8 for ($i=0; $i<count($wpvarstoreset); $i += 1) { 9 $wpvar = $wpvarstoreset[$i]; 10 if (!isset($$wpvar)) { 11 if (empty($_POST["$wpvar"])) { 12 if (empty($_GET["$wpvar"])) { 13 $$wpvar = ''; 14 } else { 15 $$wpvar = $_GET["$wpvar"]; 16 } 17 } else { 18 $$wpvar = $_POST["$wpvar"]; 19 } 20 } 21 } 7 wp_reset_vars(array('action')); 22 8 23 9 if (isset($_POST['deletepost'])) { 24 10 $action = "delete"; -
Sewar/WordPress/SVN/wp-admin/plugin-editor.php
4 4 $title = __("Edit Plugins"); 5 5 $parent_file = 'plugins.php'; 6 6 7 $wpvarstoreset = array('action','redirect','profile','error','warning','a','file'); 8 for ($i=0; $i<count($wpvarstoreset); $i += 1) { 9 $wpvar = $wpvarstoreset[$i]; 10 if (!isset($$wpvar)) { 11 if (empty($_POST["$wpvar"])) { 12 if (empty($_GET["$wpvar"])) { 13 $$wpvar = ''; 14 } else { 15 $$wpvar = $_GET["$wpvar"]; 16 } 17 } else { 18 $$wpvar = $_POST["$wpvar"]; 19 } 20 } 21 } 7 wp_reset_vars(array('action', 'redirect', 'profile', 'error', 'warning', 'a', 'file')); 22 8 23 9 $plugins = get_plugins(); 24 10 $plugin_files = array_keys($plugins); -
Sewar/WordPress/SVN/wp-admin/post.php
3 3 4 4 $parent_file = 'edit.php'; 5 5 $submenu_file = 'edit.php'; 6 $wpvarstoreset = array('action', 'safe_mode', 'withcomments', 'posts', 'content', 'edited_post_title', 'comment_error', 'profile', 'trackback_url', 'excerpt', 'showcomments', 'commentstart', 'commentend', 'commentorder' );7 6 8 for ($i=0; $i<count($wpvarstoreset); $i += 1) { 9 $wpvar = $wpvarstoreset[$i]; 10 if (!isset($$wpvar)) { 11 if (empty($_POST["$wpvar"])) { 12 if (empty($_GET["$wpvar"])) { 13 $$wpvar = ''; 14 } else { 15 $$wpvar = $_GET["$wpvar"]; 16 } 17 } else { 18 $$wpvar = $_POST["$wpvar"]; 19 } 20 } 21 } 7 wp_reset_vars(array('action', 'safe_mode', 'withcomments', 'posts', 'content', 'edited_post_title', 'comment_error', 'profile', 'trackback_url', 'excerpt', 'showcomments', 'commentstart', 'commentend', 'commentorder')); 22 8 23 9 if ( isset( $_POST['deletepost'] ) ) 24 10 $action = 'delete'; -
Sewar/WordPress/SVN/wp-admin/templates.php
3 3 $title = __('Template & File Editing'); 4 4 $parent_file = 'edit.php'; 5 5 6 $wpvarstoreset = array('action','redirect','profile','error','warning','a','file'); 7 for ($i=0; $i<count($wpvarstoreset); $i += 1) { 8 $wpvar = $wpvarstoreset[$i]; 9 if (!isset($$wpvar)) { 10 if (empty($_POST["$wpvar"])) { 11 if (empty($_GET["$wpvar"])) { 12 $$wpvar = ''; 13 } else { 14 $$wpvar = $_GET["$wpvar"]; 15 } 16 } else { 17 $$wpvar = $_POST["$wpvar"]; 18 } 19 } 20 } 6 wp_reset_vars(array('action', 'redirect', 'profile', 'error', 'warning', 'a', 'file')); 21 7 22 8 $recents = get_option('recently_edited'); 23 9 -
Sewar/WordPress/SVN/wp-admin/theme-editor.php
4 4 $title = __("Edit Themes"); 5 5 $parent_file = 'themes.php'; 6 6 7 $wpvarstoreset = array('action','redirect','profile','error','warning','a','file', 'theme'); 8 for ($i=0; $i<count($wpvarstoreset); $i += 1) { 9 $wpvar = $wpvarstoreset[$i]; 10 if (!isset($$wpvar)) { 11 if (empty($_POST["$wpvar"])) { 12 if (empty($_GET["$wpvar"])) { 13 $$wpvar = ''; 14 } else { 15 $$wpvar = $_GET["$wpvar"]; 16 } 17 } else { 18 $$wpvar = $_POST["$wpvar"]; 19 } 20 } 21 } 7 wp_reset_vars(array('action', 'redirect', 'profile', 'error', 'warning', 'a', 'file', 'theme')); 22 8 23 9 $themes = get_themes(); 24 10 -
Sewar/WordPress/SVN/wp-admin/user-edit.php
8 8 $parent_file = 'profile.php'; 9 9 $submenu_file = 'users.php'; 10 10 11 $wpvarstoreset = array('action', 'redirect', 'profile', 'user_id', 'wp_http_referer'); 12 for ($i=0; $i<count($wpvarstoreset); $i += 1) { 13 $wpvar = $wpvarstoreset[$i]; 14 if (!isset($$wpvar)) { 15 if (empty($_POST["$wpvar"])) { 16 if (empty($_GET["$wpvar"])) { 17 $$wpvar = ''; 18 } else { 19 $$wpvar = $_GET["$wpvar"]; 20 } 21 } else { 22 $$wpvar = $_POST["$wpvar"]; 23 } 24 } 25 } 11 wp_reset_vars(array('action', 'redirect', 'profile', 'user_id', 'wp_http_referer')); 26 12 27 13 $wp_http_referer = remove_query_arg(array('update', 'delete_count'), stripslashes($wp_http_referer)); 28 14