Compare commits

...

49 Commits
2.0.5 ... 2.0.7

Author SHA1 Message Date
ryan
b31237de2e Tagging 2.0.7
git-svn-id: http://svn.automattic.com/wordpress/tags/2.0.7@4731 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-01-15 20:51:28 +00:00
markjaquith
0eb7d3c7d2 Flight 2.0.7 now arriving at gate 2.0.x
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4730 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-01-15 19:20:09 +00:00
ryan
be3db885e7 Bump
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4729 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-01-14 04:06:40 +00:00
markjaquith
8dd70353ad That'll teach me to trust a code snippet from php.net ... typo fix from last commit. relates to #3528
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4725 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-01-12 21:46:29 +00:00
markjaquith
6a11d0b794 Use http_response_code for in status_header() on PHP >= 4.3.0 per Ryan's suggestion. relates to #3528
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4724 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-01-12 21:41:48 +00:00
ryan
f43a8d7566 Zend hash del key or index fix. PRops MarkJaquith.
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4717 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-01-11 03:06:28 +00:00
markjaquith
a98c116399 Backport of HTTP_IF_MODIFIED_SINCE double stripslashes() fix. fixes #2597
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4715 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-01-10 13:50:30 +00:00
markjaquith
8a367a1602 Tastes like FeedBurning... er, bumping.
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4714 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-01-10 10:13:57 +00:00
markjaquith
a2324a4487 Reverting non-essential stuff for a mean-and-lean 2.0.7 release
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4709 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-01-09 10:04:49 +00:00
ryan
e4851992ce Inline uploader fix from smalldust. fixes #2990
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4706 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-01-09 08:25:39 +00:00
markjaquith
1516281e70 Typo correction from flinkflonk. fixes #3538
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4697 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-01-07 13:56:31 +00:00
markjaquith
3f5472892f Exit gracefully with a warning if the table_prefix uses disallowed chars. table_prefix cleanup for wp-settings.php to jive with trunk and note impending deprecation of table_prefix. fixes #3537
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4696 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-01-07 09:43:34 +00:00
markjaquith
755316f391 Avoid AYS for page deletion, and redirect to page list after deletion. fixes #3536
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4692 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-01-07 07:32:12 +00:00
markjaquith
10e58f6ee8 Working on 2.0.7 now
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4685 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-01-06 08:25:39 +00:00
markjaquith
c54fd7a243 burn in Hades, status_header(), destroyer of souls. fixes #3528
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4684 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-01-06 08:22:12 +00:00
markjaquith
94bf4acfc0 Change wording for Blogger import to note that it only works with OLD Blogger accounts. Props foolswisdom. fixes #3490
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4680 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-01-05 08:46:27 +00:00
markjaquith
92a6143e65 2.0.6 ump-bay
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4678 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-01-05 08:39:45 +00:00
markjaquith
1d58dcdcba Delay Trackback data escaping until after mb_convert_encoding(). Props to Stefan Esser.
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4677 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-01-05 05:46:01 +00:00
ryan
b1b79a5ebd Add kses protocol checking to clean_url. Props Andy. fixes #3515
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4672 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-01-02 21:22:41 +00:00
ryan
8f8cb400d1 RC2
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4668 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2006-12-28 17:44:00 +00:00
markjaquith
fbd8f67ffd wp_specialchars() treatment for recent file list
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4665 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2006-12-27 05:59:20 +00:00
markjaquith
bf83dbd55f Sync balanceTags() and force_balance_tags() to trunk. fixes #2714
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4663 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2006-12-23 06:33:24 +00:00
ryan
70902a4e04 Add js_escape and attribute_escape filters.
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4661 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2006-12-22 05:27:45 +00:00
markjaquith
3495490d2f Whitespace cleanup for [4656]
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4657 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2006-12-21 10:45:58 +00:00
markjaquith
be708ef9a7 new function for escaping within attributes: attribute_escape()
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4656 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2006-12-21 10:10:04 +00:00
ryan
8ca9789e29 kses function reorg to match trunk.
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4653 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2006-12-21 01:54:15 +00:00
markjaquith
e0bf270665 Let my candidate go!
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4647 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2006-12-15 18:50:55 +00:00
markjaquith
6fd3cacaa2 _() => __() typo fix. props tai. fixes #1540
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4641 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2006-12-11 21:24:02 +00:00
markjaquith
d308d88f46 Enable quicktags for Safari. Props mattyrob. fixes #3051
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4640 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2006-12-10 22:26:40 +00:00
markjaquith
07d1b2759f Revert overzealous i18n from [4545]. Props nbachiyski. fixes #3438
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4636 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2006-12-10 00:23:10 +00:00
markjaquith
988e4018fa Don't dbxize wrappers. Props andy. fixes #2987
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4632 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2006-12-08 22:40:05 +00:00
markjaquith
709bdc5d9a Add überpowerful "query" filter, for SQL queries. fixes #2721
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4620 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2006-12-07 00:02:24 +00:00
markjaquith
49cb0def04 trailingslashit() fix for paged posts links from activeingredient. fixes #3163
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4604 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2006-12-04 14:45:08 +00:00
markjaquith
1a3f75b48a change post_parent on orphaned attachments. props ryanscheuermann. fixes #2681
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4602 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2006-12-04 14:31:09 +00:00
markjaquith
4c99f09227 To beta, or not to beta... this joke sounds best in the U.K. (BEE-tah)
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4599 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2006-12-04 12:58:47 +00:00
ryan
16f9581218 Fix pregs. Props Mordred.
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4581 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2006-12-01 22:42:14 +00:00
ryan
fd47a416c5 Can't pass function return to array_shift.
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4555 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2006-11-30 07:31:21 +00:00
ryan
f5d26b3033 gettext date format strings in wp_get_archives. fixes #1540
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4545 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2006-11-29 21:34:51 +00:00
ryan
b6f11d1a09 Filter post_content_filtered
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4533 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2006-11-25 17:54:41 +00:00
markjaquith
d198bc8c34 Avoid confusion: next version in 2.0 branch will be 2.0.6
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4532 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2006-11-25 06:53:18 +00:00
markjaquith
c699a495a1 ID fixes to allow label clicking in the moderation queue, from JeremyVisser. fixes #3391
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4531 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2006-11-25 06:37:24 +00:00
ryan
0c3ff47735 Include post_content_filtered in queries to comply with MySQL strict mode. fixes #3112
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4530 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2006-11-25 06:30:05 +00:00
markjaquith
57ff8770c0 trying Ryan's suggestion for #3215
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4514 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2006-11-22 04:59:31 +00:00
ryan
4411066167 Handle empty authors list. Props MichaelH. fixes #2384
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4496 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2006-11-19 08:05:46 +00:00
ryan
d0cc33e98e Quote strings in SQL with single quotes instead of double quotes to be more correct and consistent. Props WillemGrooters. fixes #3367
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4493 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2006-11-19 07:41:12 +00:00
ryan
440297d7a8 Reg singletons.
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4487 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2006-11-19 00:16:27 +00:00
markjaquith
22ad434597 silence the fopen() in wp_remote_fopen()
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4473 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2006-11-15 22:47:17 +00:00
markjaquith
00c98cc513 Set extract type and rename car to avoid overwrites (backport from trunk [4469])
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4471 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2006-11-15 22:29:20 +00:00
markjaquith
27da557de4 backport of post-redirect exit() fixes from [4467] and [4468]
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4470 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2006-11-15 22:23:43 +00:00
47 changed files with 267 additions and 200 deletions

View File

@@ -289,7 +289,7 @@ function get_default_post_to_edit() {
else if ( !empty($post_title) ) {
$text = wp_specialchars(stripslashes(urldecode($_REQUEST['text'])));
$text = funky_javascript_fix($text);
$popupurl = wp_specialchars($_REQUEST['popupurl']);
$popupurl = attribute_escape(stripslashes($_REQUEST['popupurl']));
$post_content = '<a href="'.$popupurl.'">'.$post_title.'</a>'."\n$text";
}
@@ -337,17 +337,17 @@ function get_category_to_edit($id) {
function get_user_to_edit($user_id) {
$user = new WP_User($user_id);
$user->user_login = wp_specialchars($user->user_login, 1);
$user->user_email = wp_specialchars($user->user_email, 1);
$user->user_url = wp_specialchars($user->user_url, 1);
$user->first_name = wp_specialchars($user->first_name, 1);
$user->last_name = wp_specialchars($user->last_name, 1);
$user->display_name = wp_specialchars($user->display_name, 1);
$user->nickname = wp_specialchars($user->nickname, 1);
$user->aim = wp_specialchars($user->aim, 1);
$user->yim = wp_specialchars($user->yim, 1);
$user->jabber = wp_specialchars($user->jabber, 1);
$user->description = wp_specialchars($user->description);
$user->user_login = attribute_escape($user->user_login);
$user->user_email = attribute_escape($user->user_email);
$user->user_url = attribute_escape($user->user_url);
$user->first_name = attribute_escape($user->first_name);
$user->last_name = attribute_escape($user->last_name);
$user->display_name = attribute_escape($user->display_name);
$user->nickname = attribute_escape($user->nickname);
$user->aim = attribute_escape($user->aim);
$user->yim = attribute_escape($user->yim);
$user->jabber = attribute_escape($user->jabber);
$user->description = wp_specialchars($user->description);
return $user;
}
@@ -467,26 +467,26 @@ function edit_user($user_id = 0) {
function get_link_to_edit($link_id) {
$link = get_link($link_id);
$link->link_url = wp_specialchars($link->link_url, 1);
$link->link_name = wp_specialchars($link->link_name, 1);
$link->link_image = wp_specialchars($link->link_image, 1);
$link->link_description = wp_specialchars($link->link_description, 1);
$link->link_notes = wp_specialchars($link->link_notes);
$link->link_rss = wp_specialchars($link->link_rss, 1);
$link->link_rel = wp_specialchars($link->link_rel, 1);
$link->post_category = $link->link_category;
$link->link_url = attribute_escape($link->link_url);
$link->link_name = attribute_escape($link->link_name);
$link->link_image = attribute_escape($link->link_image);
$link->link_description = attribute_escape($link->link_description);
$link->link_rss = attribute_escape($link->link_rss);
$link->link_rel = attribute_escape($link->link_rel);
$link->link_notes = wp_specialchars($link->link_notes);
$link->post_category = $link->link_category;
return $link;
}
function get_default_link_to_edit() {
if ( isset($_GET['linkurl']) )
$link->link_url = wp_specialchars($_GET['linkurl'], 1);
$link->link_url = attribute_escape($_GET['linkurl']);
else
$link->link_url = '';
if ( isset($_GET['name']) )
$link->link_name = wp_specialchars($_GET['name'], 1);
$link->link_name = attribute_escape($_GET['name']);
else
$link->link_name = '';
@@ -860,8 +860,8 @@ function list_meta($meta) {
}
}
$entry['meta_key'] = wp_specialchars( $entry['meta_key'], true );
$entry['meta_value'] = wp_specialchars( $entry['meta_value'], true );
$entry['meta_key'] = attribute_escape( $entry['meta_key']);
$entry['meta_value'] = attribute_escape( $entry['meta_value']);
echo "
<tr class='$style'>
<td valign='top'><input name='meta[{$entry['meta_id']}][key]' tabindex='6' type='text' size='20' value='{$entry['meta_key']}' /></td>
@@ -912,7 +912,7 @@ function meta_form() {
<?php
foreach ($keys as $key) {
$key = wp_specialchars($key, 1);
$key = attribute_escape($key);
echo "\n\t<option value='$key'>$key</option>";
}
?>
@@ -1121,15 +1121,13 @@ function save_mod_rewrite_rules() {
}
function the_quicktags() {
// Browser detection sucks, but until Safari supports the JS needed for this to work people just assume it's a bug in WP
if (!strstr($_SERVER['HTTP_USER_AGENT'], 'Safari'))
echo '
<div id="quicktags">
<script src="../wp-includes/js/quicktags.js" type="text/javascript"></script>
<script type="text/javascript">if ( typeof tinyMCE == "undefined" || tinyMCE.configs.length < 1 ) edToolbar();</script>
</div>
';
else echo '
echo '
<script type="text/javascript">
function edInsertContent(myField, myValue) {
//IE support

View File

@@ -37,7 +37,7 @@ else
$content = wp_specialchars($_REQUEST['content']);
$popupurl = wp_specialchars($_REQUEST['popupurl']);
$popupurl = attribute_escape(stripslashes($_REQUEST['popupurl']));
if ( !empty($content) ) {
$post->post_content = wp_specialchars( stripslashes($_REQUEST['content']) );
} else {

View File

@@ -33,6 +33,7 @@ case 'addcat':
wp_insert_category($_POST);
wp_redirect('categories.php?message=1#addcat');
exit;
break;
case 'delete':
@@ -51,7 +52,7 @@ case 'delete':
wp_delete_category($cat_ID);
wp_redirect('categories.php?message=2');
exit;
break;
case 'edit':
@@ -68,12 +69,12 @@ case 'edit':
<table class="editform" width="100%" cellspacing="2" cellpadding="5">
<tr>
<th width="33%" scope="row"><?php _e('Category name:') ?></th>
<td width="67%"><input name="cat_name" type="text" value="<?php echo wp_specialchars($category->cat_name); ?>" size="40" /> <input type="hidden" name="action" value="editedcat" />
<td width="67%"><input name="cat_name" type="text" value="<?php echo attribute_escape($category->cat_name); ?>" size="40" /> <input type="hidden" name="action" value="editedcat" />
<input type="hidden" name="cat_ID" value="<?php echo $category->cat_ID ?>" /></td>
</tr>
<tr>
<th scope="row"><?php _e('Category slug:') ?></th>
<td><input name="category_nicename" type="text" value="<?php echo wp_specialchars($category->category_nicename); ?>" size="40" /></td>
<td><input name="category_nicename" type="text" value="<?php echo attribute_escape($category->category_nicename); ?>" size="40" /></td>
</tr>
<tr>
<th scope="row"><?php _e('Category parent:') ?></th>
@@ -85,7 +86,7 @@ case 'edit':
</tr>
<tr>
<th scope="row"><?php _e('Description:') ?></th>
<td><textarea name="category_description" rows="5" cols="50" style="width: 97%;"><?php echo wp_specialchars($category->category_description, 1); ?></textarea></td>
<td><textarea name="category_description" rows="5" cols="50" style="width: 97%;"><?php echo wp_specialchars($category->category_description); ?></textarea></td>
</tr>
</table>
<p class="submit"><input type="submit" name="submit" value="<?php _e('Edit category') ?> &raquo;" /></p>
@@ -106,6 +107,7 @@ case 'editedcat':
wp_update_category($_POST);
wp_redirect('categories.php?message=3');
exit;
break;
default:

View File

@@ -7,7 +7,7 @@ $list_js = true;
require_once('admin-header.php');
if (empty($_GET['mode'])) $mode = 'view';
else $mode = wp_specialchars($_GET['mode'], 1);
else $mode = attribute_escape($_GET['mode']);
?>
<script type="text/javascript">
@@ -30,7 +30,7 @@ function checkAll(form)
<form name="searchform" action="" method="get">
<fieldset>
<legend><?php _e('Show Comments That Contain...') ?></legend>
<input type="text" name="s" value="<?php if (isset($_GET['s'])) echo wp_specialchars($_GET['s'], 1); ?>" size="17" />
<input type="text" name="s" value="<?php if (isset($_GET['s'])) echo attribute_escape($_GET['s']); ?>" size="17" />
<input type="submit" name="submit" value="<?php _e('Search') ?>" />
<input type="hidden" name="mode" value="<?php echo $mode; ?>" />
<?php _e('(Searches within comment text, e-mail, URI, and IP address.)') ?>

View File

@@ -211,11 +211,11 @@ if ('publish' != $post->post_status || 0 == $post_ID) {
?>
<input name="referredby" type="hidden" id="referredby" value="<?php
if ( !empty($_REQUEST['popupurl']) )
echo wp_specialchars($_REQUEST['popupurl']);
else if ( url_to_postid(wp_get_referer()) == $post_ID )
echo attribute_escape(stripslashes($_REQUEST['popupurl']));
else if ( url_to_postid(stripslashes(wp_get_referer())) == $post_ID )
echo 'redo';
else
echo wp_specialchars(wp_get_referer());
echo attribute_escape(stripslashes(wp_get_referer()));
?>" /></p>
<?php do_action('edit_form_advanced'); ?>
@@ -232,23 +232,23 @@ if (current_user_can('upload_files')) {
<div id="advancedstuff" class="dbx-group" >
<div class="dbx-box-wrapper">
<div class="dbx-b-ox-wrapper">
<fieldset id="postexcerpt" class="dbx-box">
<div class="dbx-handle-wrapper">
<div class="dbx-h-andle-wrapper">
<h3 class="dbx-handle"><?php _e('Optional Excerpt') ?></h3>
</div>
<div class="dbx-content-wrapper">
<div class="dbx-c-ontent-wrapper">
<div class="dbx-content"><textarea rows="1" cols="40" name="excerpt" tabindex="6" id="excerpt"><?php echo $post->post_excerpt ?></textarea></div>
</div>
</fieldset>
</div>
<div class="dbx-box-wrapper">
<div class="dbx-b-ox-wrapper">
<fieldset id="trackbacksdiv" class="dbx-box">
<div class="dbx-handle-wrapper">
<div class="dbx-h-andle-wrapper">
<h3 class="dbx-handle"><?php _e('Trackbacks') ?></h3>
</div>
<div class="dbx-content-wrapper">
<div class="dbx-c-ontent-wrapper">
<div class="dbx-content"><?php _e('Send trackbacks to'); ?>: <?php echo $form_trackback; ?> (<?php _e('Separate multiple URIs with spaces'); ?>)
<?php
if ( ! empty($pings) )
@@ -259,12 +259,12 @@ if ( ! empty($pings) )
</fieldset>
</div>
<div class="dbx-box-wrapper">
<div class="dbx-b-ox-wrapper">
<fieldset id="postcustom" class="dbx-box">
<div class="dbx-handle-wrapper">
<div class="dbx-h-andle-wrapper">
<h3 class="dbx-handle"><?php _e('Custom Fields') ?></h3>
</div>
<div class="dbx-content-wrapper">
<div class="dbx-c-ontent-wrapper">
<div id="postcustomstuff" class="dbx-content">
<?php
if($metadata = has_meta($post_ID)) {

View File

@@ -230,7 +230,7 @@ function xfn_check($class, $value = '', $type = 'check') {
<?php if ( $editing ) : ?>
<input type="hidden" name="action" value="editlink" />
<input type="hidden" name="link_id" value="<?php echo (int) $link_id; ?>" />
<input type="hidden" name="order_by" value="<?php echo wp_specialchars($order_by, 1); ?>" />
<input type="hidden" name="order_by" value="<?php echo attribute_escape($order_by); ?>" />
<input type="hidden" name="cat_id" value="<?php echo (int) $cat_id ?>" />
<?php else: ?>
<input type="hidden" name="action" value="Add" />

View File

@@ -14,11 +14,10 @@ if (0 == $post_ID) {
$form_extra = "<input type='hidden' id='post_ID' name='post_ID' value='$post_ID' />";
}
$sendto = wp_get_referer();
$sendto = attribute_escape(wp_get_referer());
if ( 0 != $post_ID && $sendto == get_permalink($post_ID) )
$sendto = 'redo';
$sendto = wp_specialchars( $sendto );
?>

View File

@@ -13,7 +13,7 @@ require_once('admin-header.php');
<form name="searchform" action="" method="get">
<fieldset>
<legend><?php _e('Search Pages&hellip;') ?></legend>
<input type="text" name="s" value="<?php if (isset($_GET['s'])) echo wp_specialchars($_GET['s'], 1); ?>" size="17" />
<input type="text" name="s" value="<?php if (isset($_GET['s'])) echo attribute_escape($_GET['s']); ?>" size="17" />
<input type="submit" name="submit" value="<?php _e('Search') ?>" />
</fieldset>
</form>

View File

@@ -79,7 +79,7 @@ if ( is_month() ) {
<form name="searchform" action="" method="get" style="float: left; width: 16em; margin-right: 3em;">
<fieldset>
<legend><?php _e('Search Posts&hellip;') ?></legend>
<input type="text" name="s" value="<?php if (isset($s)) echo wp_specialchars($s, 1); ?>" size="17" />
<input type="text" name="s" value="<?php if (isset($s)) echo attribute_escape($s); ?>" size="17" />
<input type="submit" name="submit" value="<?php _e('Search') ?>" />
</fieldset>
</form>

View File

@@ -7,14 +7,15 @@ class Blogger_Import {
// Shows the welcome screen and the magic iframe.
function greet() {
$title = __('Import Blogger');
$welcome = __('Howdy! This importer allows you to import posts and comments from your Blogger account into your WordPress blog.');
$title = __('Import Old Blogger');
$welcome = __('Howdy! This importer allows you to import posts and comments from your Old Blogger account into your WordPress blog.');
$noiframes = __('This feature requires iframe support.');
$warning = __('This will delete everything saved by the Blogger importer except your posts and comments. Are you sure you want to do this?');
$reset = __('Reset this importer');
$incompat = __('Your web server is not properly configured to use this importer. Please enable the CURL extension for PHP and then reload this page.');
echo "<div class='wrap'><h2>$title</h2><p>$welcome</p>";
echo "<p>" . __('Please note that this importer <em>does not work with Blogger (using your Google account)</em>.') . "</p>";
if ( function_exists('curl_init') )
echo "<iframe src='admin.php?import=blogger&amp;noheader=true' height='350px' width = '99%'>$noiframes</iframe><p><a href='admin.php?import=blogger&amp;restart=true&amp;noheader=true' onclick='return confirm(\"$warning\")'>$reset</a></p>";
else
@@ -662,6 +663,6 @@ class Blogger_Import {
$blogger_import = new Blogger_Import();
register_importer('blogger', __('Blogger and Blogspot'), __('Import <strong>posts and comments</strong> from your Blogger account'), array ($blogger_import, 'start'));
register_importer('blogger', __('Old Blogger'), __('Import <strong>posts and comments</strong> from your Old Blogger account'), array ($blogger_import, 'start'));
?>

View File

@@ -240,7 +240,7 @@ srcb[{$ID}] = '{$image['guid']}';
$xpadding = (128 - $image['uwidth']) / 2;
$ypadding = (96 - $image['uheight']) / 2;
$style .= "#target{$ID} img { padding: {$ypadding}px {$xpadding}px; }\n";
$title = wp_specialchars($image['post_title'], ENT_QUOTES);
$title = attribute_escape($image['post_title']);
$script .= "aa[{$ID}] = '<a id=\"p{$ID}\" rel=\"attachment\" class=\"imagelink\" href=\"$href\" onclick=\"doPopup({$ID});return false;\" title=\"{$title}\">';
ab[{$ID}] = '<a class=\"imagelink\" href=\"{$image['guid']}\" onclick=\"doPopup({$ID});return false;\" title=\"{$title}\">';
imga[{$ID}] = '<img id=\"image{$ID}\" src=\"$src\" alt=\"{$title}\" $height_width />';
@@ -260,7 +260,7 @@ imgb[{$ID}] = '<img id=\"image{$ID}\" src=\"{$image['guid']}\" alt=\"{$title}\"
</div>
";
} else {
$title = wp_specialchars($attachment['post_title'], ENT_QUOTES);
$title = attribute_escape($attachment['post_title']);
$filename = basename($attachment['guid']);
$icon = get_attachment_icon($ID);
$toggle_icon = "<a id=\"I{$ID}\" onclick=\"toggleOtherIcon({$ID});return false;\" href=\"javascript:void()\">$__using_title</a>";
@@ -431,7 +431,7 @@ richedit = ( typeof tinyMCE == 'object' && tinyMCE.configs.length > 0 );
function sendToEditor(n) {
o = document.getElementById('div'+n);
h = o.innerHTML.replace(new RegExp('^\\s*(.*?)\\s*$', ''), '$1'); // Trim
h = h.replace(new RegExp(' (class|title|width|height|id|onclick|onmousedown)=([^\'"][^ ]*)( |/|>)', 'g'), ' $1="$2"$3'); // Enclose attribs in quotes
h = h.replace(new RegExp(' (class|title|width|height|id|onclick|onmousedown)=([^\'"][^ ]*)(?=( |/|>))', 'g'), ' $1="$2"'); // Enclose attribs in quotes
h = h.replace(new RegExp(' (width|height)=".*?"', 'g'), ''); // Drop size constraints
h = h.replace(new RegExp(' on(click|mousedown)="[^"]*"', 'g'), ''); // Drop menu events
h = h.replace(new RegExp('<(/?)A', 'g'), '<$1a'); // Lowercase tagnames

View File

@@ -124,7 +124,7 @@ switch ($action) {
<table class="editform" width="100%" cellspacing="2" cellpadding="5">
<tr>
<th width="33%" scope="row"><?php _e('Name:') ?></th>
<td width="67%"><input name="cat_name" type="text" value="<?php echo wp_specialchars($row->cat_name)?>" size="30" /></td>
<td width="67%"><input name="cat_name" type="text" value="<?php echo attribute_escape($row->cat_name)?>" size="30" /></td>
</tr>
<tr>
<th scope="row"><?php _e('Show:') ?></th>

View File

@@ -63,6 +63,7 @@ switch ($action) {
$q = $wpdb->query("update $wpdb->links SET link_owner='$newowner' WHERE link_id IN ($all_links)");
wp_redirect($this_file);
exit;
break;
}
case 'visibility':
@@ -100,6 +101,7 @@ switch ($action) {
}
wp_redirect($this_file);
exit;
break;
}
case 'move':
@@ -120,6 +122,7 @@ switch ($action) {
$q = $wpdb->query("update $wpdb->links SET link_category='$category' WHERE link_id IN ($all_links)");
wp_redirect($this_file);
exit();
break;
}
@@ -130,6 +133,7 @@ switch ($action) {
add_link();
wp_redirect(wp_get_referer() . '?added=true');
exit;
break;
} // end Add
@@ -151,6 +155,7 @@ switch ($action) {
setcookie('links_show_cat_id_' . COOKIEHASH, $links_show_cat_id, time()+600);
wp_redirect($this_file);
exit;
break;
} // end Save
@@ -174,6 +179,7 @@ switch ($action) {
$links_show_cat_id = $cat_id;
setcookie('links_show_cat_id_' . COOKIEHASH, $links_show_cat_id, time()+600);
wp_redirect($this_file);
exit;
break;
} // end Delete
@@ -321,7 +327,7 @@ function checkAll(form)
<?php wp_nonce_field('bulk-bookmarks') ?>
<input type="hidden" name="link_id" value="" />
<input type="hidden" name="action" value="" />
<input type="hidden" name="order_by" value="<?php echo wp_specialchars($order_by, 1); ?>" />
<input type="hidden" name="order_by" value="<?php echo attribute_escape($order_by); ?>" />
<input type="hidden" name="cat_id" value="<?php echo (int) $cat_id ?>" />
<table id="the-list-x" width="100%" cellpadding="3" cellspacing="3">
<tr>
@@ -351,10 +357,10 @@ function checkAll(form)
$links = $wpdb->get_results($sql);
if ($links) {
foreach ($links as $link) {
$link->link_name = wp_specialchars($link->link_name);
$link->link_name = attribute_escape($link->link_name);
$link->link_category = wp_specialchars($link->link_category);
$link->link_description = wp_specialchars($link->link_description);
$link->link_url = wp_specialchars($link->link_url);
$link->link_url = attribute_escape($link->link_url);
$short_url = str_replace('http://', '', $link->link_url);
$short_url = str_replace('www.', '', $short_url);
if ('/' == substr($short_url, -1))

View File

@@ -152,10 +152,10 @@ echo '<a href="post.php?action=editcomment&amp;comment='.$comment->comment_ID.'"
<a href="<?php echo get_permalink($comment->comment_post_ID); ?>"><?php _e('View Post') ?></a> |
<?php
echo " <a href=\"" . wp_nonce_url("post.php?action=deletecomment&amp;p=".$comment->comment_post_ID."&amp;comment=".$comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . "\" onclick=\"return deleteSomething( 'comment', $comment->comment_ID, '" . __("You are about to delete this comment.\\n&quot;Cancel&quot; to stop, &quot;OK&quot; to delete.") . "' );\">" . __('Delete just this comment') . "</a> | "; ?> <?php _e('Bulk action:') ?>
<input type="radio" name="comment[<?php echo $comment->comment_ID; ?>]" id="comment-<?php echo $comment->comment_ID; ?>-approve" value="approve" /> <label for="comment[<?php echo $comment->comment_ID; ?>]-approve"><?php _e('Approve') ?></label>
<input type="radio" name="comment[<?php echo $comment->comment_ID; ?>]" id="comment-<?php echo $comment->comment_ID; ?>-spam" value="spam" /> <label for="comment[<?php echo $comment->comment_ID; ?>]-spam"><?php _e('Spam') ?></label>
<input type="radio" name="comment[<?php echo $comment->comment_ID; ?>]" id="comment-<?php echo $comment->comment_ID; ?>-delete" value="delete" /> <label for="comment[<?php echo $comment->comment_ID; ?>]-delete"><?php _e('Delete') ?></label>
<input type="radio" name="comment[<?php echo $comment->comment_ID; ?>]" id="comment-<?php echo $comment->comment_ID; ?>-nothing" value="later" checked="checked" /> <label for="comment[<?php echo $comment->comment_ID; ?>]-nothing"><?php _e('Defer until later') ?></label>
<input type="radio" name="comment[<?php echo $comment->comment_ID; ?>]" id="comment-<?php echo $comment->comment_ID; ?>-approve" value="approve" /> <label for="comment-<?php echo $comment->comment_ID; ?>-approve"><?php _e('Approve') ?></label>
<input type="radio" name="comment[<?php echo $comment->comment_ID; ?>]" id="comment-<?php echo $comment->comment_ID; ?>-spam" value="spam" /> <label for="comment-<?php echo $comment->comment_ID; ?>-spam"><?php _e('Spam') ?></label>
<input type="radio" name="comment[<?php echo $comment->comment_ID; ?>]" id="comment-<?php echo $comment->comment_ID; ?>-delete" value="delete" /> <label for="comment-<?php echo $comment->comment_ID; ?>-delete"><?php _e('Delete') ?></label>
<input type="radio" name="comment[<?php echo $comment->comment_ID; ?>]" id="comment-<?php echo $comment->comment_ID; ?>-nothing" value="later" checked="checked" /> <label for="comment-<?php echo $comment->comment_ID; ?>-nothing"><?php _e('Defer until later') ?></label>
</p>
</li>

View File

@@ -17,7 +17,7 @@ include('admin-header.php');
<table class="editform optiontable">
<tr valign="top">
<th scope="row"><?php _e('Store uploads in this folder'); ?>:</th>
<td><input name="upload_path" type="text" id="upload_path" class="code" value="<?php echo wp_specialchars(str_replace(ABSPATH, '', get_settings('upload_path')), 1); ?>" size="40" />
<td><input name="upload_path" type="text" id="upload_path" class="code" value="<?php echo attribute_escape(str_replace(ABSPATH, '', get_settings('upload_path'))); ?>" size="40" />
<br />
<?php _e('Default is <code>wp-content/uploads</code>'); ?>
</td>

View File

@@ -148,7 +148,7 @@ checked="checked"
</label>
<br />
</p>
<p id="customstructure"><?php _e('Custom structure'); ?>: <input name="permalink_structure" id="permalink_structure" type="text" class="code" style="width: 60%;" value="<?php echo wp_specialchars($permalink_structure, 1); ?>" size="50" /></p>
<p id="customstructure"><?php _e('Custom structure'); ?>: <input name="permalink_structure" id="permalink_structure" type="text" class="code" style="width: 60%;" value="<?php echo attribute_escape($permalink_structure); ?>" size="50" /></p>
<h3><?php _e('Optional'); ?></h3>
<?php if ($is_apache) : ?>
@@ -157,7 +157,7 @@ checked="checked"
<p><?php _e('If you like, you may enter a custom prefix for your category URIs here. For example, <code>/index.php/taxonomy/tags</code> would make your category links like <code>http://example.org/index.php/taxonomy/tags/uncategorized/</code>. If you leave this blank the default will be used.') ?></p>
<?php endif; ?>
<p>
<?php _e('Category base'); ?>: <input name="category_base" type="text" class="code" value="<?php echo wp_specialchars($category_base, 1); ?>" size="30" />
<?php _e('Category base'); ?>: <input name="category_base" type="text" class="code" value="<?php echo attribute_escape($category_base); ?>" size="30" />
</p>
<p class="submit">
<input type="submit" name="submit" value="<?php _e('Update Permalink Structure &raquo;') ?>" />

View File

@@ -182,7 +182,7 @@ endforeach;
?>
</table>
<?php $options_to_update = implode(',', $options_to_update); ?>
<p class="submit"><input type="hidden" name="page_options" value="<?php echo wp_specialchars($options_to_update, true); ?>" /><input type="submit" name="Update" value="<?php _e('Update Options &raquo;') ?>" /></p>
<p class="submit"><input type="hidden" name="page_options" value="<?php echo attribute_escape($options_to_update); ?>" /><input type="submit" name="Update" value="<?php _e('Update Options &raquo;') ?>" /></p>
</form>
</div>

View File

@@ -81,7 +81,7 @@ case 'edit':
?>
<div id='preview' class='wrap'>
<h2 id="preview-post"><?php _e('Post Preview (updated when post is saved)'); ?> <small class="quickjump"><a href="#write-post"><?php _e('edit &uarr;'); ?></a></small></h2>
<iframe src="<?php echo wp_specialchars(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post->ID)))); ?>" width="100%" height="600" ></iframe>
<iframe src="<?php echo attribute_escape(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post->ID)))); ?>" width="100%" height="600" ></iframe>
</div>
<?php
break;
@@ -138,10 +138,13 @@ case 'editpost':
case 'delete':
$post_id = (isset($_GET['post'])) ? intval($_GET['post']) : intval($_POST['post_ID']);
check_admin_referer('delete-post_' . $post_id);
$post = & get_post($post_id);
if ( 'static' == $post->post_status )
check_admin_referer('delete-page_' . $post_id);
else
check_admin_referer('delete-post_' . $post_id);
if ( !current_user_can('edit_post', $post_id) )
die( __('You are not allowed to delete this post.') );
@@ -154,9 +157,12 @@ case 'delete':
}
$sendback = wp_get_referer();
if (strstr($sendback, 'post.php')) $sendback = get_settings('siteurl') .'/wp-admin/post.php';
elseif (strstr($sendback, 'attachments.php')) $sendback = get_settings('siteurl') .'/wp-admin/attachments.php';
$sendback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $sendback);
if ( 'static' == $post->post_status )
$sendback = get_option('siteurl') . '/wp-admin/edit-pages.php';
elseif ( strstr($sendback, 'post.php') )
$sendback = get_option('siteurl') .'/wp-admin/post.php';
elseif ( strstr($sendback, 'attachments.php') )
$sendback = get_option('siteurl') .'/wp-admin/attachments.php';
wp_redirect($sendback);
break;
@@ -338,7 +344,7 @@ case 'editedcomment':
$location = ( empty($_POST['referredby']) ? "edit.php?p=$comment_post_ID&c=1" : $_POST['referredby'] ) . '#comment-' . $comment_ID;
$location = apply_filters('comment_edit_redirect', $location, $comment_ID);
wp_redirect($location);
exit();
break;
default:

View File

@@ -111,7 +111,7 @@ if ( $recents ) :
<?php
echo '<ol>';
foreach ($recents as $recent) :
echo "<li><a href='templates.php?file=" . wp_specialchars($recent, true) . "'>" . get_file_description(basename($recent)) . "</a></li>";
echo "<li><a href='templates.php?file=" . attribute_escape($recent) . "'>" . wp_specialchars(get_file_description(basename($recent))) . "</a></li>";
endforeach;
echo '</ol>';
endif;

View File

@@ -101,7 +101,7 @@ default:
$theme_name = $a_theme['Name'];
if ($theme_name == $theme) $selected = " selected='selected'";
else $selected = '';
$theme_name = wp_specialchars($theme_name, true);
$theme_name = attribute_escape($theme_name);
echo "\n\t<option value=\"$theme_name\" $selected>$theme_name</option>";
}
?>

View File

@@ -67,7 +67,7 @@ text-align: center; border-top: 1px solid #ccc; padding-top: 1em; font-style: it
switch($step) {
case 0:
$goback = wp_specialchars(wp_get_referer());
$goback = attribute_escape(stripslashes(wp_get_referer()));
?>
<p><?php _e('This file upgrades you from any previous version of WordPress to the latest. It may take a while though, so be patient.'); ?></p>
<h2 class="step"><a href="upgrade.php?step=1&amp;backto=<?php echo $goback; ?>"><?php _e('Upgrade WordPress &raquo;'); ?></a></h2>
@@ -86,7 +86,7 @@ switch($step) {
if ( empty( $_GET['backto'] ) )
$backto = __get_option('home');
else
$backto = wp_specialchars( $_GET['backto'] , 1 );
$backto = attribute_escape(stripslashes($_GET['backto']));
?>
<h2><?php _e('Step 1'); ?></h2>
<p><?php printf(__("There's actually only one step. So if you see this, you're done. <a href='%s'>Have fun</a>!"), $backto); ?></p>

View File

@@ -15,6 +15,7 @@ case 'promote':
if (empty($_POST['users'])) {
wp_redirect('users.php');
exit();
}
if ( !current_user_can('edit_users') )
@@ -34,6 +35,7 @@ case 'promote':
}
wp_redirect('users.php?update=' . $update);
exit();
break;
@@ -43,6 +45,7 @@ case 'dodelete':
if ( empty($_POST['users']) ) {
wp_redirect('users.php');
exit();
}
if ( !current_user_can('edit_users') )
@@ -67,15 +70,17 @@ case 'dodelete':
}
wp_redirect('users.php?update=' . $update);
exit();
break;
case 'delete':
check_admin_referer('bulk-users');
if ( empty($_POST['users']) )
if ( empty($_POST['users']) ) {
wp_redirect('users.php');
exit();
}
if ( !current_user_can('edit_users') )
$error['edit_users'] = __('You can&#8217;t delete users.');
@@ -135,9 +140,9 @@ case 'adduser':
$errors = add_user();
if(count($errors) == 0) {
if ( count($errors) == 0 ) {
wp_redirect('users.php?update=add');
die();
exit();
}
default:

View File

@@ -888,7 +888,7 @@ input.disabled, textarea.disabled {
background: #2685af url(images/box-head-right.gif) no-repeat top right;
}
#advancedstuff div.dbx-handle-wrapper {
#advancedstuff div.dbx-h-andle-wrapper {
margin: 0 0 0 -7px;
background: #fff url(images/box-head-left.gif) no-repeat top left;
}
@@ -904,7 +904,7 @@ input.disabled, textarea.disabled {
padding-right: 17px;
}
#advancedstuff div.dbx-content-wrapper {
#advancedstuff div.dbx-c-ontent-wrapper {
margin-left: -7px;
margin-right: 0;
background: url(images/box-bg-left.gif) repeat-y left;
@@ -916,11 +916,11 @@ input.disabled, textarea.disabled {
background: url(images/box-butt-right.gif) no-repeat bottom right;
}
#advancedstuff div.dbx-box-wrapper {
#advancedstuff div.dbx-b-ox-wrapper {
background: url(images/box-butt-left.gif) no-repeat bottom left;
}
#advancedstuff .dbx-box-closed div.dbx-content-wrapper {
#advancedstuff .dbx-box-closed div.dbx-c-ontent-wrapper {
padding-bottom: 2px;
background: url(images/box-butt-left.gif) no-repeat bottom left;
}

View File

@@ -60,7 +60,7 @@ if (!empty($commentstatus->post_password) && $_COOKIE['wp-postpass_'. COOKIEHASH
<input type="text" name="author" id="author" class="textarea" value="<?php echo $comment_author; ?>" size="28" tabindex="1" />
<label for="author"><?php _e("Name"); ?></label>
<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
<input type="hidden" name="redirect_to" value="<?php echo wp_specialchars($_SERVER["REQUEST_URI"]); ?>" />
<input type="hidden" name="redirect_to" value="<?php echo attribute_escape($_SERVER["REQUEST_URI"]); ?>" />
</p>
<p>

View File

@@ -60,7 +60,7 @@ if (!empty($post->post_password) && $_COOKIE['wp-postpass_'. COOKIEHASH] != $pos
<input type="text" name="author" id="author" class="textarea" value="<?php echo $comment_author; ?>" size="28" tabindex="1" />
<label for="author">Name</label>
<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
<input type="hidden" name="redirect_to" value="<?php echo wp_specialchars($_SERVER["REQUEST_URI"]); ?>" />
<input type="hidden" name="redirect_to" value="<?php echo attribute_escape($_SERVER["REQUEST_URI"]); ?>" />
</p>
<p>

View File

@@ -1,5 +1,5 @@
<form method="get" id="searchform" action="<?php bloginfo('home'); ?>/">
<div><input type="text" value="<?php echo wp_specialchars($s, 1); ?>" name="s" id="s" />
<div><input type="text" value="<?php echo attribute_escape($s); ?>" name="s" id="s" />
<input type="submit" id="searchsubmit" value="Search" />
</div>
</form>

View File

@@ -30,9 +30,7 @@ function wp_cache_get($id, $flag = '') {
}
function wp_cache_init() {
global $wp_object_cache;
$wp_object_cache = new WP_Object_Cache();
$GLOBALS['wp_object_cache'] =& new WP_Object_Cache();
}
function wp_cache_replace($key, $data, $flag = '', $expire = 0) {

View File

@@ -598,13 +598,13 @@ class WP_Query {
}
if ( $this->is_attachment ) {
$where .= ' AND (post_status = "attachment")';
$where .= " AND (post_status = 'attachment')";
} elseif ($this->is_page) {
$where .= ' AND (post_status = "static")';
$where .= " AND (post_status = 'static')";
} elseif ($this->is_single) {
$where .= ' AND (post_status != "static")';
$where .= " AND (post_status != 'static')";
} else {
$where .= ' AND (post_status = "publish"';
$where .= " AND (post_status = 'publish'";
if (isset($user_ID) && ('' != intval($user_ID)))
$where .= " OR post_author = $user_ID AND post_status != 'draft' AND post_status != 'static')";
@@ -613,7 +613,7 @@ class WP_Query {
}
if (! $this->is_attachment )
$where .= ' AND post_status != "attachment"';
$where .= " AND post_status != 'attachment'";
// Apply filters on where and join prior to paging so that any
// manipulations to them are reflected in the paging by day queries.
@@ -1637,7 +1637,8 @@ class WP {
@header("ETag: $wp_etag");
// Support for Conditional GET
if (isset($_SERVER['HTTP_IF_NONE_MATCH'])) $client_etag = stripslashes($_SERVER['HTTP_IF_NONE_MATCH']);
if (isset($_SERVER['HTTP_IF_NONE_MATCH']))
$client_etag = stripslashes(stripslashes($_SERVER['HTTP_IF_NONE_MATCH']));
else $client_etag = false;
$client_last_modified = trim( $_SERVER['HTTP_IF_MODIFIED_SINCE']);

View File

@@ -213,17 +213,6 @@ function wp_delete_comment($comment_id) {
return true;
}
function clean_url( $url ) {
if ('' == $url) return $url;
$url = preg_replace('|[^a-z0-9-~+_.?#=&;,/:%]|i', '', $url);
$strip = array('%0d', '%0a');
$url = str_replace($strip, '', $url);
$url = str_replace(';//', '://', $url);
$url = (!strstr($url, '://')) ? 'http://'.$url : $url;
$url = preg_replace('/&([^#])(?![a-z]{2,8};)/', '&#038;$1', $url);
return $url;
}
function get_comments_number( $post_id = 0 ) {
global $wpdb, $comment_count_cache, $id;
$post_id = (int) $post_id;
@@ -315,7 +304,7 @@ function comments_popup_link($zero='No Comments', $one='1 Comment', $more='% Com
if (!empty($CSSclass)) {
echo ' class="'.$CSSclass.'"';
}
$title = wp_specialchars(apply_filters('the_title', get_the_title()), true);
$title = attribute_escape(apply_filters('the_title', get_the_title()));
echo ' title="' . sprintf( __('Comment on %s'), $title ) .'">';
comments_number($zero, $one, $more, $number);
echo '</a>';
@@ -897,21 +886,21 @@ function sanitize_comment_cookies() {
if ( isset($_COOKIE['comment_author_'.COOKIEHASH]) ) {
$comment_author = apply_filters('pre_comment_author_name', $_COOKIE['comment_author_'.COOKIEHASH]);
$comment_author = stripslashes($comment_author);
$comment_author = wp_specialchars($comment_author, true);
$comment_author = attribute_escape($comment_author);
$_COOKIE['comment_author_'.COOKIEHASH] = $comment_author;
}
if ( isset($_COOKIE['comment_author_email_'.COOKIEHASH]) ) {
$comment_author_email = apply_filters('pre_comment_author_email', $_COOKIE['comment_author_email_'.COOKIEHASH]);
$comment_author_email = stripslashes($comment_author_email);
$comment_author_email = wp_specialchars($comment_author_email, true);
$comment_author_email = attribute_escape($comment_author_email);
$_COOKIE['comment_author_email_'.COOKIEHASH] = $comment_author_email;
}
if ( isset($_COOKIE['comment_author_url_'.COOKIEHASH]) ) {
$comment_author_url = apply_filters('pre_comment_author_url', $_COOKIE['comment_author_url_'.COOKIEHASH]);
$comment_author_url = stripslashes($comment_author_url);
$comment_author_url = wp_specialchars($comment_author_url, true);
$comment_author_url = attribute_escape($comment_author_url);
$_COOKIE['comment_author_url_'.COOKIEHASH] = $comment_author_url;
}
}

View File

@@ -399,26 +399,27 @@ function funky_javascript_fix($text) {
/*
balanceTags
Balances Tags of string using a modified stack.
@param text Text to be balanced
@param force Forces balancing, ignoring the value of the option
@return Returns balanced text
@author Leonard Lin (leonard@acm.org)
@version v1.1
@date November 4, 2001
@license GPL v2.0
@notes
@changelog
@notes
@changelog
--- Modified by Scott Reilly (coffee2code) 02 Aug 2004
1.2 ***TODO*** Make better - change loop condition to $text
1.1 Fixed handling of append/stack pop order of end text
Added Cleaning Hooks
1.0 First Version
1.2 ***TODO*** Make better - change loop condition to $text
1.1 Fixed handling of append/stack pop order of end text
Added Cleaning Hooks
1.0 First Version
*/
function balanceTags($text, $is_comment = 0) {
if ( get_option('use_balanceTags') == 0)
function balanceTags($text, $force = false) {
if ( !$force && get_option('use_balanceTags') == 0 )
return $text;
$tagstack = array(); $stacksize = 0; $tagqueue = ''; $newtext = '';
@@ -440,7 +441,7 @@ function balanceTags($text, $is_comment = 0) {
if ($regex[1][0] == "/") { // End Tag
$tag = strtolower(substr($regex[1],1));
// if too many closing tags
if($stacksize <= 0) {
if($stacksize <= 0) {
$tag = '';
//or close to be safe $tag = '/' . $tag;
}
@@ -497,7 +498,7 @@ function balanceTags($text, $is_comment = 0) {
}
$newtext .= substr($text,0,$i) . $tag;
$text = substr($text,$i+$l);
}
}
// Clear Tag Queue
$newtext .= $tagqueue;
@@ -518,7 +519,7 @@ function balanceTags($text, $is_comment = 0) {
}
function force_balance_tags($text) {
return balanceTags($text, 0, true);
return balanceTags($text, true);
}
function format_to_edit($content, $richedit = false) {
@@ -1044,10 +1045,33 @@ function wp_richedit_pre($text) {
return apply_filters('richedit_pre', $output);
}
function clean_url( $url, $protocols = null ) {
if ('' == $url) return $url;
$url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%]|i', '', $url);
$strip = array('%0d', '%0a');
$url = str_replace($strip, '', $url);
$url = str_replace(';//', '://', $url);
$url = (!strstr($url, '://')) ? 'http://'.$url : $url;
$url = preg_replace('/&([^#])(?![a-z]{2,8};)/', '&#038;$1', $url);
if ( !is_array($protocols) )
$protocols = array('http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet');
if ( wp_kses_bad_protocol( $url, $protocols ) != $url )
return '';
return $url;
}
// Escape single quotes, specialchar double quotes, and fix line endings.
function js_escape($text) {
$text = wp_specialchars($text, 'double');
$text = str_replace('&#039;', "'", $text);
return preg_replace("/\r?\n/", "\\n", addslashes($text));
$safe_text = wp_specialchars($text, 'double');
$safe_text = str_replace('&#039;', "'", $safe_text);
$safe_text = preg_replace("/\r?\n/", "\\n", addslashes($safe_text));
return apply_filters('js_escape', $safe_text, $text);
}
// Escaping for HTML attributes
function attribute_escape($text) {
$safe_text = wp_specialchars($text, true);
return apply_filters('attribute_escape', $safe_text, $text);
}
?>

View File

@@ -24,6 +24,7 @@ function wp_insert_post($postarr = array()) {
// Get the basics.
$post_content = apply_filters('content_save_pre', $post_content);
$post_content_filtered = apply_filters('content_filtered_save_pre', $post_content_filtered);
$post_excerpt = apply_filters('excerpt_save_pre', $post_excerpt);
$post_title = apply_filters('title_save_pre', $post_title);
$post_category = apply_filters('category_save_pre', $post_category);
@@ -221,6 +222,7 @@ function wp_insert_attachment($object, $file = false, $post_parent = 0) {
// Get the basics.
$post_content = apply_filters('content_save_pre', $post_content);
$post_content_filtered = apply_filters('content_filtered_save_pre', $post_content_filtered);
$post_excerpt = apply_filters('excerpt_save_pre', $post_excerpt);
$post_title = apply_filters('title_save_pre', $post_title);
$post_category = apply_filters('category_save_pre', $post_category);
@@ -302,6 +304,7 @@ function wp_insert_attachment($object, $file = false, $post_parent = 0) {
post_date = '$post_date',
post_date_gmt = '$post_date_gmt',
post_content = '$post_content',
post_content_filtered = '$post_content_filtered',
post_title = '$post_title',
post_excerpt = '$post_excerpt',
post_status = '$post_status',
@@ -321,9 +324,9 @@ function wp_insert_attachment($object, $file = false, $post_parent = 0) {
} else {
$wpdb->query(
"INSERT INTO $wpdb->posts
(post_author, post_date, post_date_gmt, post_content, post_title, post_excerpt, post_status, comment_status, ping_status, post_password, post_name, to_ping, pinged, post_modified, post_modified_gmt, post_parent, menu_order, post_mime_type, guid)
(post_author, post_date, post_date_gmt, post_content, post_content_filtered, post_title, post_excerpt, post_status, comment_status, ping_status, post_password, post_name, to_ping, pinged, post_modified, post_modified_gmt, post_parent, menu_order, post_mime_type, guid)
VALUES
('$post_author', '$post_date', '$post_date_gmt', '$post_content', '$post_title', '$post_excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password', '$post_name', '$to_ping', '$pinged', '$post_date', '$post_date_gmt', '$post_parent', '$menu_order', '$post_mime_type', '$guid')");
('$post_author', '$post_date', '$post_date_gmt', '$post_content', '$post_content_filtered', '$post_title', '$post_excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password', '$post_name', '$to_ping', '$pinged', '$post_date', '$post_date_gmt', '$post_parent', '$menu_order', '$post_mime_type', '$guid')");
$post_ID = $wpdb->insert_id;
}
@@ -549,6 +552,8 @@ function wp_delete_post($postid = 0) {
if ( 'static' == $post->post_status )
$wpdb->query("UPDATE $wpdb->posts SET post_parent = $post->post_parent WHERE post_parent = $postid AND post_status = 'static'");
$wpdb->query("UPDATE $wpdb->posts SET post_parent = $post->post_parent WHERE post_parent = $postid AND post_status = 'attachment'");
$wpdb->query("DELETE FROM $wpdb->posts WHERE ID = $postid");
$wpdb->query("DELETE FROM $wpdb->comments WHERE comment_post_ID = $postid");

View File

@@ -349,7 +349,7 @@ function get_user_option( $option, $user = 0 ) {
}
function form_option($option) {
echo wp_specialchars( get_option($option), 1 );
echo attribute_escape( get_option($option));
}
function get_alloptions() {
@@ -2163,13 +2163,13 @@ function remove_query_arg($key, $query) {
return add_query_arg($key, '', $query);
}
function load_template($file) {
function load_template($_template_file) {
global $posts, $post, $wp_did_header, $wp_did_template_redirect, $wp_query,
$wp_rewrite, $wpdb;
extract($wp_query->query_vars);
extract($wp_query->query_vars, EXTR_SKIP);
require_once($file);
require_once($_template_file);
}
function add_magic_quotes($array) {
@@ -2187,7 +2187,7 @@ function add_magic_quotes($array) {
function wp_remote_fopen( $uri ) {
if ( ini_get('allow_url_fopen') ) {
$fp = fopen( $uri, 'r' );
$fp = @fopen( $uri, 'r' );
if ( !$fp )
return false;
$linea = '';
@@ -2228,8 +2228,10 @@ function status_header( $header ) {
elseif ( 410 == $header )
$text = 'Gone';
@header("HTTP/1.1 $header $text");
@header("Status: $header $text");
if ( version_compare(phpversion(), '4.3.0', '>=') )
@header("HTTP/1.1 $header $text", true, $header);
else
@header("HTTP/1.1 $header $text");
}
function nocache_headers() {
@@ -2244,7 +2246,7 @@ function get_usermeta( $user_id, $meta_key = '') {
$user_id = (int) $user_id;
if ( !empty($meta_key) ) {
$meta_key = preg_replace('|a-z0-9_|i', '', $meta_key);
$meta_key = preg_replace('|[^a-z0-9_]|i', '', $meta_key);
$metas = $wpdb->get_results("SELECT meta_key, meta_value FROM $wpdb->usermeta WHERE user_id = '$user_id' AND meta_key = '$meta_key'");
} else {
$metas = $wpdb->get_results("SELECT meta_key, meta_value FROM $wpdb->usermeta WHERE user_id = '$user_id'");
@@ -2360,16 +2362,16 @@ function wp_nonce_field($action = -1) {
}
function wp_referer_field() {
$ref = wp_specialchars($_SERVER['REQUEST_URI']);
$ref = attribute_escape(stripslashes($_SERVER['REQUEST_URI']));
echo '<input type="hidden" name="_wp_http_referer" value="'. $ref . '" />';
if ( wp_get_original_referer() ) {
$original_ref = wp_specialchars(stripslashes(wp_get_original_referer()));
$original_ref = attribute_escape(stripslashes(wp_get_original_referer()));
echo '<input type="hidden" name="_wp_original_http_referer" value="'. $original_ref . '" />';
}
}
function wp_original_referer_field() {
echo '<input type="hidden" name="_wp_original_http_referer" value="' . wp_specialchars(stripslashes($_SERVER['REQUEST_URI'])) . '" />';
echo '<input type="hidden" name="_wp_original_http_referer" value="' . attribute_escape(stripslashes($_SERVER['REQUEST_URI'])) . '" />';
}
function wp_get_referer() {
@@ -2454,7 +2456,7 @@ function wp_nonce_ays($action) {
$adminurl = get_settings('siteurl') . '/wp-admin';
if ( wp_get_referer() )
$adminurl = wp_get_referer();
$adminurl = attribute_escape(stripslashes(wp_get_referer()));
$title = __('WordPress Confirmation');
// Remove extra layer of slashes.
@@ -2466,12 +2468,12 @@ function wp_nonce_ays($action) {
foreach ( (array) $q as $a ) {
$v = substr(strstr($a, '='), 1);
$k = substr($a, 0, -(strlen($v)+1));
$html .= "\t\t<input type='hidden' name='" . wp_specialchars( urldecode($k), 1 ) . "' value='" . wp_specialchars( urldecode($v), 1 ) . "' />\n";
$html .= "\t\t<input type='hidden' name='" . attribute_escape( urldecode($k)) . "' value='" . attribute_escape( urldecode($v)) . "' />\n";
}
$html .= "\t\t<input type='hidden' name='_wpnonce' value='" . wp_create_nonce($action) . "' />\n";
$html .= "\t\t<div id='message' class='confirm fade'>\n\t\t<p>" . wp_explain_nonce($action) . "</p>\n\t\t<p><a href='$adminurl'>" . __('No') . "</a> <input type='submit' value='" . __('Yes') . "' /></p>\n\t\t</div>\n\t</form>\n";
} else {
$html .= "\t<div id='message' class='confirm fade'>\n\t<p>" . wp_explain_nonce($action) . "</p>\n\t<p><a href='$adminurl'>" . __('No') . "</a> <a href='" . add_query_arg( '_wpnonce', wp_create_nonce($action), $_SERVER['REQUEST_URI'] ) . "'>" . __('Yes') . "</a></p>\n\t</div>\n";
$html .= "\t<div id='message' class='confirm fade'>\n\t<p>" . wp_explain_nonce($action) . "</p>\n\t<p><a href='$adminurl'>" . __('No') . "</a> <a href='" . attribute_escape(add_query_arg('_wpnonce', wp_create_nonce($action), $_SERVER['REQUEST_URI'])) . "'>" . __('Yes') . "</a></p>\n\t</div>\n";
}
$html .= "</body>\n</html>";
wp_die($html, $title);

View File

@@ -63,10 +63,12 @@ class gettext_reader {
function readint() {
if ($this->BYTEORDER == 0) {
// low endian
return array_shift(unpack('V', $this->STREAM->read(4)));
$low_end = unpack('V', $this->STREAM->read(4));
return array_shift($low_end);
} else {
// big endian
return array_shift(unpack('N', $this->STREAM->read(4)));
$big_end = unpack('N', $this->STREAM->read(4));
return array_shift($big_end);
}
}

View File

@@ -524,21 +524,34 @@ function wp_filter_post_kses($data) {
}
function kses_init_filters() {
add_filter('pre_comment_author', 'wp_filter_kses');
add_filter('pre_comment_content', 'wp_filter_kses');
add_filter('content_save_pre', 'wp_filter_post_kses');
add_filter('title_save_pre', 'wp_filter_kses');
// Normal filtering.
add_filter('pre_comment_content', 'wp_filter_kses');
add_filter('title_save_pre', 'wp_filter_kses');
// Post filtering
add_filter('content_save_pre', 'wp_filter_post_kses');
add_filter('excerpt_save_pre', 'wp_filter_post_kses');
add_filter('content_filtered_save_pre', 'wp_filter_post_kses');
}
function kses_remove_filters() {
// Normal filtering.
remove_filter('pre_comment_content', 'wp_filter_kses');
remove_filter('title_save_pre', 'wp_filter_kses');
// Post filtering
remove_filter('content_save_pre', 'wp_filter_post_kses');
remove_filter('excerpt_save_pre', 'wp_filter_post_kses');
remove_filter('content_filtered_save_pre', 'wp_filter_post_kses');
}
function kses_init() {
remove_filter('pre_comment_author', 'wp_filter_kses');
remove_filter('pre_comment_content', 'wp_filter_kses');
remove_filter('content_save_pre', 'wp_filter_post_kses');
remove_filter('title_save_pre', 'wp_filter_kses');
kses_remove_filters();
if (current_user_can('unfiltered_html') == false)
kses_init_filters();
}
add_action('init', 'kses_init');
add_action('set_current_user', 'kses_init');
?>

View File

@@ -212,15 +212,15 @@ function get_links($category = -1,
$the_link = '#';
if (!empty($row->link_url))
$the_link = wp_specialchars($row->link_url);
$the_link = attribute_escape($row->link_url);
$rel = $row->link_rel;
if ($rel != '') {
$rel = ' rel="' . $rel . '"';
}
$desc = wp_specialchars($row->link_description, ENT_QUOTES);
$name = wp_specialchars($row->link_name, ENT_QUOTES);
$desc = attribute_escape($row->link_description);
$name = attribute_escape($row->link_name);
$title = $desc;
if ($show_updated) {

View File

@@ -265,7 +265,8 @@ function wp_redirect($location, $status = 302) {
if ( $is_IIS ) {
header("Refresh: 0;url=$location");
} else {
status_header($status); // This causes problems on IIS
if ( php_sapi_name() != 'cgi-fcgi' )
status_header($status); // This causes problems on IIS and some FastCGI setups
header("Location: $location");
}
}

View File

@@ -131,7 +131,7 @@ function the_author_posts() {
function the_author_posts_link($deprecated = '') {
global $authordata;
echo '<a href="' . get_author_link(0, $authordata->ID, $authordata->user_nicename) . '" title="' . sprintf(__("Posts by %s"), wp_specialchars(get_the_author())) . '">' . get_the_author() . '</a>';
echo '<a href="' . get_author_link(0, $authordata->ID, $authordata->user_nicename) . '" title="' . sprintf(__("Posts by %s"), attribute_escape(get_the_author())) . '">' . get_the_author() . '</a>';
}
function get_author_link($echo = false, $author_id, $author_nicename = '') {
@@ -183,7 +183,7 @@ function list_authors($optioncount = false, $exclude_admin = true, $show_fullnam
$query = "SELECT ID, user_nicename from $wpdb->users " . ($exclude_admin ? "WHERE user_login <> 'admin' " : '') . "ORDER BY display_name";
$authors = $wpdb->get_results($query);
foreach ( $authors as $author ) {
foreach ( (array) $authors as $author ) {
$author = get_userdata( $author->ID );
$posts = get_usernumposts($author->ID);
$name = $author->nickname;
@@ -197,7 +197,7 @@ function list_authors($optioncount = false, $exclude_admin = true, $show_fullnam
if ( !$hide_empty )
$link = $name;
} else {
$link = '<a href="' . get_author_link(0, $author->ID, $author->user_nicename) . '" title="' . sprintf(__("Posts by %s"), wp_specialchars($author->display_name)) . '">' . $name . '</a>';
$link = '<a href="' . get_author_link(0, $author->ID, $author->user_nicename) . '" title="' . sprintf(__("Posts by %s"), attribute_escape($author->display_name)) . '">' . $name . '</a>';
if ( (! empty($feed_image)) || (! empty($feed)) ) {
$link .= ' ';
@@ -235,4 +235,4 @@ function list_authors($optioncount = false, $exclude_admin = true, $show_fullnam
}
}
?>
?>

View File

@@ -323,9 +323,9 @@ function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_orde
$num_found++;
$link = '<a href="'.get_category_link($category->cat_ID).'" ';
if ( $use_desc_for_title == 0 || empty($category->category_description) )
$link .= 'title="'. sprintf(__("View all posts filed under %s"), wp_specialchars($category->cat_name)) . '"';
$link .= 'title="'. sprintf(__("View all posts filed under %s"), attribute_escape($category->cat_name)) . '"';
else
$link .= 'title="' . wp_specialchars(apply_filters('category_description',$category->category_description,$category)) . '"';
$link .= 'title="' . attribute_escape(apply_filters('category_description',$category->category_description,$category)) . '"';
$link .= '>';
$link .= apply_filters('list_cats', $category->cat_name, $category).'</a>';

View File

@@ -263,7 +263,7 @@ function single_month_title($prefix = '', $display = true ) {
/* link navigation hack by Orien http://icecode.com/ */
function get_archives_link($url, $text, $format = 'html', $before = '', $after = '') {
$text = wptexturize($text);
$title_text = wp_specialchars($text, 1);
$title_text = attribute_escape($text);
if ('link' == $format)
return "\t<link rel='archives' title='$title_text' href='$url' />\n";
@@ -336,10 +336,10 @@ function get_archives($type='', $limit='', $format='html', $before = '', $after
foreach ( $arcresults as $arcresult ) {
$url = get_month_link($arcresult->year, $arcresult->month);
if ( $show_post_count ) {
$text = sprintf('%s %d', $month[zeroise($arcresult->month,2)], $arcresult->year);
$text = sprintf(__('%1$s %2$d'), $month[zeroise($arcresult->month,2)], $arcresult->year);
$after = '&nbsp;('.$arcresult->posts.')' . $afterafter;
} else {
$text = sprintf('%s %d', $month[zeroise($arcresult->month,2)], $arcresult->year);
$text = sprintf(__('%1$s %2$d'), $month[zeroise($arcresult->month,2)], $arcresult->year);
}
echo get_archives_link($url, $text, $format, $before, $after);
}
@@ -349,7 +349,7 @@ function get_archives($type='', $limit='', $format='html', $before = '', $after
if ( $arcresults ) {
foreach ( $arcresults as $arcresult ) {
$url = get_day_link($arcresult->year, $arcresult->month, $arcresult->dayofmonth);
$date = sprintf("%d-%02d-%02d 00:00:00", $arcresult->year, $arcresult->month, $arcresult->dayofmonth);
$date = sprintf('%1$d-%2$02d-%3$02d 00:00:00', $arcresult->year, $arcresult->month, $arcresult->dayofmonth);
$text = mysql2date($archive_day_date_format, $date);
echo get_archives_link($url, $text, $format, $before, $after);
}
@@ -366,7 +366,7 @@ function get_archives($type='', $limit='', $format='html', $before = '', $after
$arc_week = get_weekstartend($arcresult->yyyymmdd, get_settings('start_of_week'));
$arc_week_start = date_i18n($archive_week_start_date_format, $arc_week['start']);
$arc_week_end = date_i18n($archive_week_end_date_format, $arc_week['end']);
$url = sprintf('%s/%s%sm%s%s%sw%s%d', get_settings('home'), '', '?', '=', $arc_year, '&amp;', '=', $arcresult->week);
$url = sprintf('%1$s/%2$s%3$sm%4$s%5$s%6$sw%7$s%8$d', get_settings('home'), '', '?', '=', $arc_year, '&amp;', '=', $arcresult->week);
$text = $arc_week_start . $archive_week_separator . $arc_week_end;
echo get_archives_link($url, $text, $format, $before, $after);
}

View File

@@ -158,7 +158,7 @@ function link_pages($before='<br />', $after='<br />', $next_or_number='number',
if ( '' == get_settings('permalink_structure') )
echo '<a href="' . get_permalink() . '&amp;page=' . $i . '">';
else
echo '<a href="' . trailingslashit( get_permalink() ) . $i . '/">';
echo '<a href="' . trailingslashit(get_permalink()) . $i . '/">';
}
echo $j;
if ( ($i != $page) || ((!$more) && ($page==1)) )
@@ -173,14 +173,14 @@ function link_pages($before='<br />', $after='<br />', $next_or_number='number',
if ( '' == get_settings('permalink_structure') )
echo '<a href="' . get_permalink() . '&amp;page=' . $i . '">'.$previouspagelink.'</a>';
else
echo '<a href="' . get_permalink() . $i . '/">'.$previouspagelink.'</a>';
echo '<a href="' . get_permalink() . $i . '/">' . $previouspagelink . '</a>';
}
$i = $page + 1;
if ( $i <= $numpages && $more ) {
if ( '' == get_settings('permalink_structure') )
echo '<a href="'.get_permalink() . '&amp;page=' . $i . '">'.$nextpagelink.'</a>';
echo '<a href="' . get_permalink() . '&amp;page=' . $i . '">' . $nextpagelink . '</a>';
else
echo '<a href="'.get_permalink().$i.'/">'.$nextpagelink.'</a>';
echo '<a href="' . trailingslashit(get_permalink()) . $i . '/">' . $nextpagelink . '</a>';
}
echo $after;
}
@@ -418,7 +418,7 @@ function _page_level_out($parent, $page_tree, $args, $depth = 0, $echo = true) {
foreach ( $page_tree[$parent]['children'] as $page_id ) {
$cur_page = $page_tree[$page_id];
$title = wp_specialchars($cur_page['title']);
$title = attribute_escape($cur_page['title']);
$css_class = 'page_item';
if ( $page_id == $queried_obj->ID )

View File

@@ -2,7 +2,7 @@
// This just holds the version number, in a separate file so we can bump it without cluttering the SVN
$wp_version = '2.0.5';
$wp_version = '2.0.7';
$wp_db_version = 3441;
?>

View File

@@ -131,6 +131,11 @@ class wpdb {
// Basic Query - see docs for more detail
function query($query) {
// filter the query, if filters are available
// NOTE: some queries are made before the plugins have been loaded, and thus cannot be filtered with this method
if ( function_exists('apply_filters') )
$query = apply_filters('query', $query);
// initialise return
$return_val = 0;
$this->flush();

View File

@@ -44,12 +44,12 @@ FROM $wpdb->links
<?php
} // end if not first time
?>
<outline type="category" title="<?php echo wp_specialchars($result->cat_name); ?>">
<outline type="category" title="<?php echo attribute_escape($result->cat_name); ?>">
<?php
$prev_cat_id = $result->link_category;
} // end if new category
?>
<outline text="<?php echo wp_specialchars($result->link_name); ?>" type="link" xmlUrl="<?php echo wp_specialchars($result->link_rss); ?>" htmlUrl="<?php echo wp_specialchars($result->link_url); ?>" updated="<?php if ('0000-00-00 00:00:00' != $result->link_updated) echo $result->link_updated; ?>" />
<outline text="<?php echo attribute_escape($result->link_name); ?>" type="link" xmlUrl="<?php echo attribute_escape($result->link_rss); ?>" htmlUrl="<?php echo attribute_escape($result->link_url); ?>" updated="<?php if ('0000-00-00 00:00:00' != $result->link_updated) echo $result->link_updated; ?>" />
<?php
} // end foreach
?>

View File

@@ -127,7 +127,7 @@ break;
case 'resetpass' :
// Generate something random for a password... md5'ing current time with a rand salt
$key = preg_replace('/a-z0-9/i', '', $_GET['key']);
$key = preg_replace('/[^a-z0-9]/i', '', $_GET['key']);
if ( empty($key) )
die( __('Sorry, that key does not appear to be valid.') );
$user = $wpdb->get_row("SELECT * FROM $wpdb->users WHERE user_activation_key = '$key'");
@@ -231,14 +231,14 @@ if ( $error )
?>
<form name="loginform" id="loginform" action="wp-login.php" method="post">
<p><label><?php _e('Username:') ?><br /><input type="text" name="log" id="log" value="<?php echo wp_specialchars(stripslashes($user_login), 1); ?>" size="20" tabindex="1" /></label></p>
<p><label><?php _e('Username:') ?><br /><input type="text" name="log" id="log" value="<?php echo attribute_escape(stripslashes($user_login)); ?>" size="20" tabindex="1" /></label></p>
<p><label><?php _e('Password:') ?><br /> <input type="password" name="pwd" id="pwd" value="" size="20" tabindex="2" /></label></p>
<p>
<label><input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="3" />
<?php _e('Remember me'); ?></label></p>
<p class="submit">
<input type="submit" name="submit" id="submit" value="<?php _e('Login'); ?> &raquo;" tabindex="4" />
<input type="hidden" name="redirect_to" value="<?php echo wp_specialchars($redirect_to); ?>" />
<input type="hidden" name="redirect_to" value="<?php echo attribute_escape($redirect_to); ?>" />
</p>
</form>
<ul>

View File

@@ -113,8 +113,8 @@ default:
<?php endif; ?>
<form method="post" action="wp-register.php" id="registerform">
<p><input type="hidden" name="action" value="register" />
<label for="user_login"><?php _e('Username:') ?></label><br /> <input type="text" name="user_login" id="user_login" size="20" maxlength="20" value="<?php echo wp_specialchars($user_login); ?>" /><br /></p>
<p><label for="user_email"><?php _e('E-mail:') ?></label><br /> <input type="text" name="user_email" id="user_email" size="25" maxlength="100" value="<?php echo wp_specialchars($user_email); ?>" /></p>
<label for="user_login"><?php _e('Username:') ?></label><br /> <input type="text" name="user_login" id="user_login" size="20" maxlength="20" value="<?php echo attribute_escape($user_login); ?>" /><br /></p>
<p><label for="user_email"><?php _e('E-mail:') ?></label><br /> <input type="text" name="user_email" id="user_email" size="25" maxlength="100" value="<?php echo attribute_escape($user_email); ?>" /></p>
<p><?php _e('A password will be emailed to you.') ?></p>
<p class="submit"><input type="submit" value="<?php _e('Register') ?> &raquo;" id="submit" name="submit" /></p>
</form>

View File

@@ -12,8 +12,10 @@ function unregister_GLOBALS() {
$input = array_merge($_GET, $_POST, $_COOKIE, $_SERVER, $_ENV, $_FILES, isset($_SESSION) && is_array($_SESSION) ? $_SESSION : array());
foreach ( $input as $k => $v )
if ( !in_array($k, $noUnset) && isset($GLOBALS[$k]) )
if ( !in_array($k, $noUnset) && isset($GLOBALS[$k]) ) {
$GLOBALS[$k] = NULL;
unset($GLOBALS[$k]);
}
}
unregister_GLOBALS();
@@ -199,9 +201,10 @@ $_SERVER = add_magic_quotes($_SERVER);
do_action('sanitize_comment_cookies');
$wp_query = new WP_Query();
$wp_rewrite = new WP_Rewrite();
$wp = new WP();
$wp_the_query =& new WP_Query();
$wp_query =& $wp_the_query;
$wp_rewrite =& new WP_Rewrite();
$wp =& new WP();
define('TEMPLATEPATH', get_template_directory());
@@ -224,4 +227,4 @@ register_shutdown_function('shutdown_action_hook');
// Everything is loaded and initialized.
do_action('init');
?>
?>

View File

@@ -30,11 +30,13 @@ if ( !$_GET['tb_id'] ) {
$tb_id = intval( $tb_id[ count($tb_id) - 1 ] );
}
$tb_url = $_POST['url'];
$title = $_POST['title'];
$excerpt = $_POST['excerpt'];
$blog_name = $_POST['blog_name'];
$charset = $_POST['charset'];
$tb_url = $_POST['url'];
$charset = $_POST['charset'];
// These three are stripslashed here so that they can be properly escaped after mb_convert_encoding()
$title = stripslashes($_POST['title']);
$excerpt = stripslashes($_POST['excerpt']);
$blog_name = stripslashes($_POST['blog_name']);
if ($charset)
$charset = strtoupper( trim($charset) );
@@ -42,11 +44,16 @@ else
$charset = 'ASCII, UTF-8, ISO-8859-1, JIS, EUC-JP, SJIS';
if ( function_exists('mb_convert_encoding') ) { // For international trackbacks
$title = mb_convert_encoding($title, get_settings('blog_charset'), $charset);
$excerpt = mb_convert_encoding($excerpt, get_settings('blog_charset'), $charset);
$blog_name = mb_convert_encoding($blog_name, get_settings('blog_charset'), $charset);
$title = mb_convert_encoding($title, get_option('blog_charset'), $charset);
$excerpt = mb_convert_encoding($excerpt, get_option('blog_charset'), $charset);
$blog_name = mb_convert_encoding($blog_name, get_option('blog_charset'), $charset);
}
// Now that mb_convert_encoding() has been given a swing, we need to escape these three
$title = $wpdb->escape($title);
$excerpt = $wpdb->escape($excerpt);
$blog_name = $wpdb->escape($blog_name);
if ( is_single() || is_page() )
$tb_id = $posts[0]->ID;