Skip to content

Commit 31ea9c5

Browse files
committed
Input cleanup
git-svn-id: https://develop.svn.wordpress.org/trunk@1743 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 075ea09 commit 31ea9c5

5 files changed

Lines changed: 9 additions & 30 deletions

File tree

wp-admin/admin-header.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,6 @@
4141
<link rel="stylesheet" href="wp-admin.css" type="text/css" />
4242
<link rel="shortcut icon" href="../wp-images/wp-favicon.png" />
4343
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo get_settings('blog_charset'); ?>" />
44-
<?php
45-
if ($redirect==1) {
46-
?>
47-
<script type="text/javascript">
48-
<!--
49-
function redirect() {
50-
window.location = "<?php echo $redirect_url; ?>";
51-
}
52-
setTimeout("redirect();", 600);
53-
//-->
54-
</script>
55-
<?php
56-
} // redirect
57-
?>
5844

5945
<?php if (isset($xfn)) : ?>
6046
<script type="text/javascript">

wp-admin/bookmarklet.php

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
<?php
2-
/* <Bookmarklet> */
3-
4-
// accepts 'post_title' and 'content' as vars passed in. Add-on from Alex King
5-
62
$mode = 'bookmarklet';
73

84
$standalone = 1;
@@ -23,12 +19,11 @@
2319
</script>
2420
</head>
2521
<body></body>
26-
</html><?php
27-
22+
</html>
23+
<?php
2824
} else {
29-
30-
$popuptitle = stripslashes($popuptitle);
31-
$text = stripslashes(urldecode($text));
25+
$popuptitle = htmlspecialchars(stripslashes($popuptitle));
26+
$text = htmlspecialchars(stripslashes(urldecode($text)));
3227

3328
/* big funky fixes for browsers' javascript bugs */
3429

@@ -57,7 +52,7 @@
5752
// and that is what is being included below. For this reason, I am just duplicating
5853
// the var instead of changing the assignment on the lines above.
5954
// -- Alex King 2004-01-07
60-
$edited_post_title = $post_title;
55+
$edited_post_title = htmlspecialchars($post_title);
6156

6257
// $post_pingback needs to be set in any file that includes edit-form.php
6358
$post_pingback = get_settings('default_pingback_flag');

wp-admin/categories.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ function add_magic_quotes($array) {
9797
<h2><?php _e('Edit Category') ?></h2>
9898
<form name="editcat" action="categories.php" method="post">
9999
<input type="hidden" name="action" value="editedcat" />
100-
<input type="hidden" name="cat_ID" value="<?php echo $_GET['cat_ID'] ?>" />
100+
<input type="hidden" name="cat_ID" value="<?php echo $cat_ID ?>" />
101101
<p><?php _e('Category name:') ?><br />
102102
<input type="text" name="cat_name" value="<?php echo htmlspecialchars($cat_name); ?>" /></p>
103103
<p><?php _e('Category parent:') ?><br />

wp-admin/edit-comments.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function checkAll(form)
2828
<form name="searchform" action="" method="get">
2929
<fieldset>
3030
<legend><?php _e('Show Comments That Contain...') ?></legend>
31-
<input type="text" name="s" value="<?php if (isset($s)) echo $s; ?>" size="17" />
31+
<input type="text" name="s" value="<?php if (isset($_GET['s'])) echo htmlspecialchars($_GET['s']); ?>" size="17" />
3232
<input type="submit" name="submit" value="<?php _e('Search') ?>" />
3333
<input type="hidden" name="mode" value="<?php echo $mode; ?>" />
3434
<?php _e('(Searches within comment text, e-mail, URI, and IP address.)') ?>
@@ -148,6 +148,4 @@ function checkAll(form)
148148

149149
</div>
150150

151-
<?php
152-
include('admin-footer.php');
153-
?>
151+
<?php include('admin-footer.php'); ?>

wp-admin/edit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
if ( isset( $_GET['m'] ) ) {
6666
echo $month[substr( $_GET['m'], 4, 2 )] . ' ' . substr( $_GET['m'], 0, 4 );
6767
} elseif ( isset( $_GET['s'] ) ) {
68-
printf(__('Search for &#8220;%s&#8221;'), $_GET['s']);
68+
printf(__('Search for &#8220;%s&#8221;'), htmlspecialchars($_GET['s']) );
6969
} else {
7070
_e('Last 15 Posts');
7171
}

0 commit comments

Comments
 (0)