Trim empty lines. Nothing but newline.

git-svn-id: http://svn.automattic.com/wordpress/trunk@5700 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2007-06-14 02:25:30 +00:00
parent 72c169c2f1
commit 2f09416258
60 changed files with 432 additions and 432 deletions

View File

@ -41,7 +41,7 @@ printf( _c( '%1$s%2$s%3$s|manage pages header' ), $post_status_label, $h2_author
<input type="text" name="s" id="s" value="<?php echo attribute_escape( stripslashes( $_GET['s'] ) ); ?>" size="17" /> <input type="text" name="s" id="s" value="<?php echo attribute_escape( stripslashes( $_GET['s'] ) ); ?>" size="17" />
</fieldset> </fieldset>
<fieldset><legend><?php _e('Page Type&hellip;'); ?></legend> <fieldset><legend><?php _e('Page Type&hellip;'); ?></legend>
<select name='post_status'> <select name='post_status'>
<option<?php selected( @$_GET['post_status'], 0 ); ?> value='0'><?php _e('Any'); ?></option> <option<?php selected( @$_GET['post_status'], 0 ); ?> value='0'><?php _e('Any'); ?></option>

View File

@ -133,9 +133,9 @@ print '<?xml version="1.0" encoding="' . get_bloginfo('charset') . '"?' . ">\n";
categories. You may use this file to transfer that content from one site to categories. You may use this file to transfer that content from one site to
another. This file is not intended to serve as a complete backup of your another. This file is not intended to serve as a complete backup of your
blog. blog.
To import this information into a WordPress blog follow these steps: To import this information into a WordPress blog follow these steps:
1. Log into that blog as an administrator. 1. Log into that blog as an administrator.
2. Go to Manage > Import in the blog's admin. 2. Go to Manage > Import in the blog's admin.
3. Choose "WordPress" from the list of importers. 3. Choose "WordPress" from the list of importers.

View File

@ -915,7 +915,7 @@ class AtomParser {
if(count($this->in_content) == 2) { if(count($this->in_content) == 2) {
array_push($this->in_content, ">"); array_push($this->in_content, ">");
} }
array_push($this->in_content, "<". $this->ns_to_prefix($name) ."{$xmlns_str}{$attrs_str}"); array_push($this->in_content, "<". $this->ns_to_prefix($name) ."{$xmlns_str}{$attrs_str}");
} else if(in_array($tag, $this->ATOM_CONTENT_ELEMENTS) || in_array($tag, $this->ATOM_SIMPLE_ELEMENTS)) { } else if(in_array($tag, $this->ATOM_CONTENT_ELEMENTS) || in_array($tag, $this->ATOM_SIMPLE_ELEMENTS)) {
$this->in_content = array(); $this->in_content = array();

View File

@ -272,7 +272,7 @@ class MT_Import {
$comments = array(); $comments = array();
$ping = new StdClass(); $ping = new StdClass();
$pings = array(); $pings = array();
echo "<div class='wrap'><ol>"; echo "<div class='wrap'><ol>";
while ( $line = fgets($handle) ) { while ( $line = fgets($handle) ) {

View File

@ -1,7 +1,7 @@
<?php <?php
class UTW_Import { class UTW_Import {
function header() { function header() {
echo '<div class="wrap">'; echo '<div class="wrap">';
echo '<h2>'.__('Import Ultimate Tag Warrior').'</h2>'; echo '<h2>'.__('Import Ultimate Tag Warrior').'</h2>';
@ -23,18 +23,18 @@ class UTW_Import {
echo '</form>'; echo '</form>';
echo '</div>'; echo '</div>';
} }
function dispatch () { function dispatch () {
if ( empty( $_GET['step'] ) ) { if ( empty( $_GET['step'] ) ) {
$step = 0; $step = 0;
} else { } else {
$step = (int) $_GET['step']; $step = (int) $_GET['step'];
} }
// load the header // load the header
$this->header(); $this->header();
switch ( $step ) { switch ( $step ) {
case 0 : case 0 :
$this->greet(); $this->greet();
@ -52,18 +52,18 @@ class UTW_Import {
$this->cleanup_import(); $this->cleanup_import();
break; break;
} }
// load the footer // load the footer
$this->footer(); $this->footer();
} }
function import_tags ( ) { function import_tags ( ) {
echo '<div class="narrow">'; echo '<div class="narrow">';
echo '<p><h3>'.__('Reading UTW Tags&#8230;').'</h3></p>'; echo '<p><h3>'.__('Reading UTW Tags&#8230;').'</h3></p>';
$tags = $this->get_utw_tags(); $tags = $this->get_utw_tags();
// if we didn't get any tags back, that's all there is folks! // if we didn't get any tags back, that's all there is folks!
if ( !is_array($tags) ) { if ( !is_array($tags) ) {
echo '<p>' . __('No Tags Found!') . '</p>'; echo '<p>' . __('No Tags Found!') . '</p>';
@ -77,37 +77,37 @@ class UTW_Import {
} }
add_option('utwimp_tags', $tags); add_option('utwimp_tags', $tags);
$count = count($tags); $count = count($tags);
echo '<p>' . sprintf( __('Done! <strong>%s</strong> tags were read.'), $count ) . '<br /></p>'; echo '<p>' . sprintf( __('Done! <strong>%s</strong> tags were read.'), $count ) . '<br /></p>';
echo '<p>' . __('The following tags were found:') . '</p>'; echo '<p>' . __('The following tags were found:') . '</p>';
echo '<ul>'; echo '<ul>';
foreach ( $tags as $tag_id => $tag_name ) { foreach ( $tags as $tag_id => $tag_name ) {
echo '<li>' . $tag_name . '</li>'; echo '<li>' . $tag_name . '</li>';
} }
echo '</ul>'; echo '</ul>';
echo '<br />'; echo '<br />';
echo '<p>' . __('If you don&#8217;t want to import any of these tags, you should delete them from the UTW tag management page and then re-run this import.') . '</p>'; echo '<p>' . __('If you don&#8217;t want to import any of these tags, you should delete them from the UTW tag management page and then re-run this import.') . '</p>';
} }
echo '<form action="admin.php?import=utw&amp;step=2" method="post">'; echo '<form action="admin.php?import=utw&amp;step=2" method="post">';
echo '<p class="submit"><input type="submit" name="submit" value="'.__('Step 2 &raquo;').'" /></p>'; echo '<p class="submit"><input type="submit" name="submit" value="'.__('Step 2 &raquo;').'" /></p>';
echo '</form>'; echo '</form>';
echo '</div>'; echo '</div>';
} }
function import_posts ( ) { function import_posts ( ) {
echo '<div class="narrow">'; echo '<div class="narrow">';
echo '<p><h3>'.__('Reading UTW Post Tags&#8230;').'</h3></p>'; echo '<p><h3>'.__('Reading UTW Post Tags&#8230;').'</h3></p>';
@ -128,12 +128,12 @@ class UTW_Import {
} }
add_option('utwimp_posts', $posts); add_option('utwimp_posts', $posts);
$count = count($posts); $count = count($posts);
echo '<p>' . sprintf( __('Done! <strong>%s</strong> tag to post relationships were read.'), $count ) . '<br /></p>'; echo '<p>' . sprintf( __('Done! <strong>%s</strong> tag to post relationships were read.'), $count ) . '<br /></p>';
} }
echo '<form action="admin.php?import=utw&amp;step=3" method="post">'; echo '<form action="admin.php?import=utw&amp;step=3" method="post">';
@ -142,8 +142,8 @@ class UTW_Import {
echo '</div>'; echo '</div>';
} }
function import_t2p ( ) { function import_t2p ( ) {
echo '<div class="narrow">'; echo '<div class="narrow">';
@ -151,7 +151,7 @@ class UTW_Import {
// run that funky magic! // run that funky magic!
$tags_added = $this->tag2post(); $tags_added = $this->tag2post();
echo '<p>' . sprintf( __('Done! <strong>%s</strong> tags where added!'), $tags_added ) . '<br /></p>'; echo '<p>' . sprintf( __('Done! <strong>%s</strong> tags where added!'), $tags_added ) . '<br /></p>';
echo '<form action="admin.php?import=utw&amp;step=4" method="post">'; echo '<form action="admin.php?import=utw&amp;step=4" method="post">';
@ -160,104 +160,104 @@ class UTW_Import {
echo '</div>'; echo '</div>';
} }
function get_utw_tags ( ) { function get_utw_tags ( ) {
global $wpdb; global $wpdb;
// read in all the tags from the UTW tags table: should be wp_tags // read in all the tags from the UTW tags table: should be wp_tags
$tags_query = "SELECT tag_id, tag FROM " . $wpdb->prefix . "tags"; $tags_query = "SELECT tag_id, tag FROM " . $wpdb->prefix . "tags";
$tags = $wpdb->get_results($tags_query); $tags = $wpdb->get_results($tags_query);
// rearrange these tags into something we can actually use // rearrange these tags into something we can actually use
foreach ( $tags as $tag ) { foreach ( $tags as $tag ) {
$new_tags[$tag->tag_id] = $tag->tag; $new_tags[$tag->tag_id] = $tag->tag;
} }
return $new_tags; return $new_tags;
} }
function get_utw_posts ( ) { function get_utw_posts ( ) {
global $wpdb; global $wpdb;
// read in all the posts from the UTW post->tag table: should be wp_post2tag // read in all the posts from the UTW post->tag table: should be wp_post2tag
$posts_query = "SELECT tag_id, post_id FROM " . $wpdb->prefix . "post2tag"; $posts_query = "SELECT tag_id, post_id FROM " . $wpdb->prefix . "post2tag";
$posts = $wpdb->get_results($posts_query); $posts = $wpdb->get_results($posts_query);
return $posts; return $posts;
} }
function tag2post ( ) { function tag2post ( ) {
// get the tags and posts we imported in the last 2 steps // get the tags and posts we imported in the last 2 steps
$tags = get_option('utwimp_tags'); $tags = get_option('utwimp_tags');
$posts = get_option('utwimp_posts'); $posts = get_option('utwimp_posts');
// null out our results // null out our results
$tags_added = 0; $tags_added = 0;
// loop through each post and add its tags to the db // loop through each post and add its tags to the db
foreach ( $posts as $this_post ) { foreach ( $posts as $this_post ) {
$the_post = (int) $this_post->post_id; $the_post = (int) $this_post->post_id;
$the_tag = (int) $this_post->tag_id; $the_tag = (int) $this_post->tag_id;
// what's the tag name for that id? // what's the tag name for that id?
$the_tag = $tags[$the_tag]; $the_tag = $tags[$the_tag];
// screw it, just try to add the tag // screw it, just try to add the tag
wp_add_post_tags($the_post, $the_tag); wp_add_post_tags($the_post, $the_tag);
$tags_added++; $tags_added++;
} }
// that's it, all posts should be linked to their tags properly, pending any errors we just spit out! // that's it, all posts should be linked to their tags properly, pending any errors we just spit out!
return $tags_added; return $tags_added;
} }
function cleanup_import ( ) { function cleanup_import ( ) {
delete_option('utwimp_tags'); delete_option('utwimp_tags');
delete_option('utwimp_posts'); delete_option('utwimp_posts');
$this->done(); $this->done();
} }
function done ( ) { function done ( ) {
echo '<div class="narrow">'; echo '<div class="narrow">';
echo '<p><h3>'.__('Import Complete!').'</h3></p>'; echo '<p><h3>'.__('Import Complete!').'</h3></p>';
echo '<p>' . __('OK, so we lied about this being a 5-step program! You&#8217;re done!') . '</p>'; echo '<p>' . __('OK, so we lied about this being a 5-step program! You&#8217;re done!') . '</p>';
echo '<p>' . __('Now wasn&#8217;t that easy?') . '</p>'; echo '<p>' . __('Now wasn&#8217;t that easy?') . '</p>';
echo '</div>'; echo '</div>';
} }
function UTW_Import ( ) { function UTW_Import ( ) {
// Nothing. // Nothing.
} }
} }

View File

@ -251,14 +251,14 @@ class WP_Import {
echo '<h3>'.sprintf(__('All done.').' <a href="%s">'.__('Have fun!').'</a>', get_option('home')).'</h3>'; echo '<h3>'.sprintf(__('All done.').' <a href="%s">'.__('Have fun!').'</a>', get_option('home')).'</h3>';
} }
function process_post($post) { function process_post($post) {
global $wpdb; global $wpdb;
$post_ID = (int) $this->get_tag( $post, 'wp:post_id' ); $post_ID = (int) $this->get_tag( $post, 'wp:post_id' );
if ( $post_ID && !empty($this->posts_processed[$post_ID][1]) ) // Processed already if ( $post_ID && !empty($this->posts_processed[$post_ID][1]) ) // Processed already
return 0; return 0;
// There are only ever one of these // There are only ever one of these
$post_title = $this->get_tag( $post, 'title' ); $post_title = $this->get_tag( $post, 'title' );
$post_date = $this->get_tag( $post, 'wp:post_date' ); $post_date = $this->get_tag( $post, 'wp:post_date' );
@ -311,7 +311,7 @@ class WP_Import {
// Memorize old and new ID. // Memorize old and new ID.
if ( $post_id && $post_ID && $this->posts_processed[$post_ID] ) if ( $post_id && $post_ID && $this->posts_processed[$post_ID] )
$this->posts_processed[$post_ID][1] = $post_id; // New ID. $this->posts_processed[$post_ID][1] = $post_id; // New ID.
// Add categories. // Add categories.
if (count($categories) > 0) { if (count($categories) > 0) {
$post_cats = array(); $post_cats = array();

View File

@ -3,163 +3,163 @@
class WP_Categories_to_Tags { class WP_Categories_to_Tags {
var $categories_to_convert = array(); var $categories_to_convert = array();
var $all_categories = array(); var $all_categories = array();
function header() { function header() {
print '<div class="wrap">'; print '<div class="wrap">';
print '<h2>' . __('Convert Categories to Tags') . '</h2>'; print '<h2>' . __('Convert Categories to Tags') . '</h2>';
} }
function footer() { function footer() {
print '</div>'; print '</div>';
} }
function populate_all_categories() { function populate_all_categories() {
global $wpdb; global $wpdb;
$this->all_categories = get_categories('get=all'); $this->all_categories = get_categories('get=all');
} }
function welcome() { function welcome() {
$this->populate_all_categories(); $this->populate_all_categories();
print '<div class="narrow">'; print '<div class="narrow">';
if (count($this->all_categories) > 0) { if (count($this->all_categories) > 0) {
print '<p>' . __('Howdy! This converter allows you to selectively convert existing categories to tags. To get started, check the checkboxes of the categories you wish to be converted, then click the Convert button.') . '</p>'; print '<p>' . __('Howdy! This converter allows you to selectively convert existing categories to tags. To get started, check the checkboxes of the categories you wish to be converted, then click the Convert button.') . '</p>';
print '<p>' . __('Keep in mind that if you convert a category with child categories, those child categories get their parent setting removed, so they\'re in the root.') . '</p>'; print '<p>' . __('Keep in mind that if you convert a category with child categories, those child categories get their parent setting removed, so they\'re in the root.') . '</p>';
$this->categories_form(); $this->categories_form();
} else { } else {
print '<p>'.__('You have no categories to convert!').'</p>'; print '<p>'.__('You have no categories to convert!').'</p>';
} }
print '</div>'; print '</div>';
} }
function categories_form() { function categories_form() {
print '<form action="admin.php?import=wp-cat2tag&amp;step=2" method="post">'; print '<form action="admin.php?import=wp-cat2tag&amp;step=2" method="post">';
print '<ul style="list-style:none">'; print '<ul style="list-style:none">';
$hier = _get_term_hierarchy('category'); $hier = _get_term_hierarchy('category');
foreach ($this->all_categories as $category) { foreach ($this->all_categories as $category) {
if ((int) $category->parent == 0) { if ((int) $category->parent == 0) {
print '<li><label><input type="checkbox" name="cats_to_convert[]" value="' . intval($category->term_id) . '" /> ' . $category->name . ' (' . $category->count . ')</label>'; print '<li><label><input type="checkbox" name="cats_to_convert[]" value="' . intval($category->term_id) . '" /> ' . $category->name . ' (' . $category->count . ')</label>';
if (isset($hier[$category->term_id])) { if (isset($hier[$category->term_id])) {
$this->_category_children($category, $hier); $this->_category_children($category, $hier);
} }
print '</li>'; print '</li>';
} }
} }
print '</ul>'; print '</ul>';
print '<p class="submit"><input type="submit" name="maybe_convert_all_cats" value="' . __('Convert All Categories') . '" /> <input type="submit" name="submit" value="' . __('Convert &raquo;') . '" /></p>'; print '<p class="submit"><input type="submit" name="maybe_convert_all_cats" value="' . __('Convert All Categories') . '" /> <input type="submit" name="submit" value="' . __('Convert &raquo;') . '" /></p>';
print '</form>'; print '</form>';
} }
function _category_children($parent, $hier) { function _category_children($parent, $hier) {
print '<ul style="list-style:none">'; print '<ul style="list-style:none">';
foreach ($hier[$parent->term_id] as $child_id) { foreach ($hier[$parent->term_id] as $child_id) {
$child =& get_category($child_id); $child =& get_category($child_id);
print '<li><label><input type="checkbox" name="cats_to_convert[]" value="' . intval($child->term_id) . '" /> ' . $child->name . ' (' . $child->count . ')</label>'; print '<li><label><input type="checkbox" name="cats_to_convert[]" value="' . intval($child->term_id) . '" /> ' . $child->name . ' (' . $child->count . ')</label>';
if (isset($hier[$child->term_id])) { if (isset($hier[$child->term_id])) {
$this->_category_children($child, $hier); $this->_category_children($child, $hier);
} }
print '</li>'; print '</li>';
} }
print '</ul>'; print '</ul>';
} }
function _category_exists($cat_id) { function _category_exists($cat_id) {
global $wpdb; global $wpdb;
$cat_id = (int) $cat_id; $cat_id = (int) $cat_id;
$maybe_exists = category_exists($cat_id); $maybe_exists = category_exists($cat_id);
if ( $maybe_exists ) { if ( $maybe_exists ) {
return true; return true;
} else { } else {
return false; return false;
} }
} }
function convert_them() { function convert_them() {
global $wpdb; global $wpdb;
if (!isset($_POST['cats_to_convert']) || !is_array($_POST['cats_to_convert'])) { if (!isset($_POST['cats_to_convert']) || !is_array($_POST['cats_to_convert'])) {
print '<div class="narrow">'; print '<div class="narrow">';
print '<p>' . sprintf(__('Uh, oh. Something didn\'t work. Please <a href="%s">try again</a>.'), 'admin.php?import=wp-cat2tag') . '</p>'; print '<p>' . sprintf(__('Uh, oh. Something didn\'t work. Please <a href="%s">try again</a>.'), 'admin.php?import=wp-cat2tag') . '</p>';
print '</div>'; print '</div>';
} }
if ( empty($this->categories_to_convert) ) if ( empty($this->categories_to_convert) )
$this->categories_to_convert = $_POST['cats_to_convert']; $this->categories_to_convert = $_POST['cats_to_convert'];
$hier = _get_term_hierarchy('category'); $hier = _get_term_hierarchy('category');
print '<ul>'; print '<ul>';
foreach ($this->categories_to_convert as $cat_id) { foreach ($this->categories_to_convert as $cat_id) {
$cat_id = (int) $cat_id; $cat_id = (int) $cat_id;
print '<li>' . __('Converting category') . ' #' . $cat_id . '... '; print '<li>' . __('Converting category') . ' #' . $cat_id . '... ';
if (!$this->_category_exists($cat_id)) { if (!$this->_category_exists($cat_id)) {
_e('Category doesn\'t exist!'); _e('Category doesn\'t exist!');
} else { } else {
$category =& get_category($cat_id); $category =& get_category($cat_id);
// Set the category itself to $type from above // Set the category itself to $type from above
$wpdb->query("UPDATE $wpdb->term_taxonomy SET taxonomy = 'post_tag' WHERE term_id = '{$category->term_id}' AND taxonomy = 'category'"); $wpdb->query("UPDATE $wpdb->term_taxonomy SET taxonomy = 'post_tag' WHERE term_id = '{$category->term_id}' AND taxonomy = 'category'");
// Set all parents to 0 (root-level) if their parent was the converted tag // Set all parents to 0 (root-level) if their parent was the converted tag
$wpdb->query("UPDATE $wpdb->term_taxonomy SET parent = 0 WHERE parent = '{$category->term_id}' AND taxonomy = 'category'"); $wpdb->query("UPDATE $wpdb->term_taxonomy SET parent = 0 WHERE parent = '{$category->term_id}' AND taxonomy = 'category'");
// Clean the cache // Clean the cache
clean_category_cache($category->term_id); clean_category_cache($category->term_id);
_e('Converted successfully.'); _e('Converted successfully.');
} }
print '</li>'; print '</li>';
} }
print '</ul>'; print '</ul>';
} }
function convert_all_confirm() { function convert_all_confirm() {
print '<div class="narrow">'; print '<div class="narrow">';
print '<h3>' . __('Confirm') . '</h3>'; print '<h3>' . __('Confirm') . '</h3>';
print '<p>' . __('You are about to convert all categories to tags. Are you sure you want to continue?') . '</p>'; print '<p>' . __('You are about to convert all categories to tags. Are you sure you want to continue?') . '</p>';
print '<form action="admin.php?import=wp-cat2tag" method="post">'; print '<form action="admin.php?import=wp-cat2tag" method="post">';
print '<p style="text-align:center" class="submit"><input type="submit" value="' . __('Yes') . '" name="yes_convert_all_cats" />&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" value="' . __('No') . '" name="no_dont_do_it" /></p>'; print '<p style="text-align:center" class="submit"><input type="submit" value="' . __('Yes') . '" name="yes_convert_all_cats" />&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" value="' . __('No') . '" name="no_dont_do_it" /></p>';
print '</form>'; print '</form>';
print '</div>'; print '</div>';
} }
function convert_all() { function convert_all() {
global $wpdb; global $wpdb;
$wpdb->query("UPDATE $wpdb->term_taxonomy SET taxonomy = 'post_tag', parent = 0 WHERE taxonomy = 'category'"); $wpdb->query("UPDATE $wpdb->term_taxonomy SET taxonomy = 'post_tag', parent = 0 WHERE taxonomy = 'category'");
clean_category_cache($category->term_id); clean_category_cache($category->term_id);
} }
function init() { function init() {
echo '<!--'; print_r($_POST); print_r($_GET); echo '-->'; echo '<!--'; print_r($_POST); print_r($_GET); echo '-->';
if (isset($_POST['maybe_convert_all_cats'])) { if (isset($_POST['maybe_convert_all_cats'])) {
$step = 3; $step = 3;
} elseif (isset($_POST['yes_convert_all_cats'])) { } elseif (isset($_POST['yes_convert_all_cats'])) {
@ -169,9 +169,9 @@ class WP_Categories_to_Tags {
} else { } else {
$step = (isset($_GET['step'])) ? (int) $_GET['step'] : 1; $step = (isset($_GET['step'])) ? (int) $_GET['step'] : 1;
} }
$this->header(); $this->header();
if (!current_user_can('manage_categories')) { if (!current_user_can('manage_categories')) {
print '<div class="narrow">'; print '<div class="narrow">';
print '<p>' . __('Cheatin&#8217; uh?') . '</p>'; print '<p>' . __('Cheatin&#8217; uh?') . '</p>';
@ -181,24 +181,24 @@ class WP_Categories_to_Tags {
case 1 : case 1 :
$this->welcome(); $this->welcome();
break; break;
case 2 : case 2 :
$this->convert_them(); $this->convert_them();
break; break;
case 3 : case 3 :
$this->convert_all_confirm(); $this->convert_all_confirm();
break; break;
case 4 : case 4 :
$this->convert_all(); $this->convert_all();
break; break;
} }
} }
$this->footer(); $this->footer();
} }
function WP_Categories_to_Tags() { function WP_Categories_to_Tags() {
// Do nothing. // Do nothing.
} }

View File

@ -46,7 +46,7 @@ function wp_delete_link($link_id) {
wp_delete_object_term_relationships($link_id, 'link_category'); wp_delete_object_term_relationships($link_id, 'link_category');
$wpdb->query("DELETE FROM $wpdb->links WHERE link_id = '$link_id'"); $wpdb->query("DELETE FROM $wpdb->links WHERE link_id = '$link_id'");
do_action('deleted_link', $link_id); do_action('deleted_link', $link_id);
return true; return true;

View File

@ -138,7 +138,7 @@ function wp_handle_upload( &$file, $overrides = false ) {
if ( ( !$type || !$ext ) && !current_user_can( 'unfiltered_upload' ) ) if ( ( !$type || !$ext ) && !current_user_can( 'unfiltered_upload' ) )
return $upload_error_handler( $file, __( 'File type does not meet security guidelines. Try another.' )); return $upload_error_handler( $file, __( 'File type does not meet security guidelines. Try another.' ));
if ( !$ext ) if ( !$ext )
$ext = strrchr($file['name'], '.'); $ext = strrchr($file['name'], '.');
} }

View File

@ -121,7 +121,7 @@ function wp_crop_image( $src_file, $src_x, $src_y, $src_w, $src_h, $dst_w, $dst_
if (function_exists('imageantialias')) if (function_exists('imageantialias'))
imageantialias( $dst, true ); imageantialias( $dst, true );
imagecopyresampled( $dst, $src, 0, 0, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h ); imagecopyresampled( $dst, $src, 0, 0, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h );
if ( !$dst_file ) if ( !$dst_file )

View File

@ -7,7 +7,7 @@ function get_plugin_data( $plugin_file ) {
preg_match( '|Description:(.*)$|mi', $plugin_data, $description ); preg_match( '|Description:(.*)$|mi', $plugin_data, $description );
preg_match( '|Author:(.*)$|mi', $plugin_data, $author_name ); preg_match( '|Author:(.*)$|mi', $plugin_data, $author_name );
preg_match( '|Author URI:(.*)$|mi', $plugin_data, $author_uri ); preg_match( '|Author URI:(.*)$|mi', $plugin_data, $author_uri );
if ( preg_match( "|Version:(.*)|i", $plugin_data, $version )) if ( preg_match( "|Version:(.*)|i", $plugin_data, $version ))
$version = trim( $version[1] ); $version = trim( $version[1] );
else else

View File

@ -392,7 +392,7 @@ function populate_roles_210() {
function populate_roles_230() { function populate_roles_230() {
$role = get_role( 'administrator' ); $role = get_role( 'administrator' );
if ( !empty( $role ) ) { if ( !empty( $role ) ) {
$role->add_cap( 'unfiltered_upload' ); $role->add_cap( 'unfiltered_upload' );
} }

View File

@ -149,7 +149,7 @@ function dropdown_link_categories( $default = 0 ) {
} }
$categories = get_terms('link_category', 'orderby=count&hide_empty=0'); $categories = get_terms('link_category', 'orderby=count&hide_empty=0');
if ( empty($categories) ) if ( empty($categories) )
return; return;
@ -421,7 +421,7 @@ function touch_time( $edit = 1, $for_post = 1 ) {
if ( $for_post ) if ( $for_post )
$edit = ( ('draft' == $post->post_status ) && (!$post->post_date || '0000-00-00 00:00:00' == $post->post_date ) ) ? false : true; $edit = ( ('draft' == $post->post_status ) && (!$post->post_date || '0000-00-00 00:00:00' == $post->post_date ) ) ? false : true;
echo '<fieldset><legend><input type="checkbox" class="checkbox" name="edit_date" value="1" id="timestamp" /> <label for="timestamp">'.__( 'Edit timestamp' ).'</label></legend>'; echo '<fieldset><legend><input type="checkbox" class="checkbox" name="edit_date" value="1" id="timestamp" /> <label for="timestamp">'.__( 'Edit timestamp' ).'</label></legend>';
$time_adj = time() + (get_option( 'gmt_offset' ) * 3600 ); $time_adj = time() + (get_option( 'gmt_offset' ) * 3600 );

View File

@ -33,7 +33,7 @@ function get_page_templates() {
if ( is_array( $templates ) ) { if ( is_array( $templates ) ) {
foreach ( $templates as $template ) { foreach ( $templates as $template ) {
$template_data = implode( '', file( ABSPATH.$template )); $template_data = implode( '', file( ABSPATH.$template ));
preg_match( '|Template Name:(.*)$|mi', $template_data, $name ); preg_match( '|Template Name:(.*)$|mi', $template_data, $name );
preg_match( '|Description:(.*)$|mi', $template_data, $description ); preg_match( '|Description:(.*)$|mi', $template_data, $description );

View File

@ -187,11 +187,11 @@ function upgrade_all() {
if ( $wp_current_db_version < 4351 ) if ( $wp_current_db_version < 4351 )
upgrade_old_slugs(); upgrade_old_slugs();
if ( $wp_current_db_version < 5539 ) if ( $wp_current_db_version < 5539 )
upgrade_230(); upgrade_230();
maybe_disable_automattic_widgets(); maybe_disable_automattic_widgets();
$wp_rewrite->flush_rules(); $wp_rewrite->flush_rules();
@ -576,7 +576,7 @@ function upgrade_210() {
function upgrade_230() { function upgrade_230() {
global $wp_current_db_version, $wpdb; global $wp_current_db_version, $wpdb;
if ( $wp_current_db_version < 5200 ) { if ( $wp_current_db_version < 5200 ) {
populate_roles_230(); populate_roles_230();
} }
@ -628,7 +628,7 @@ function upgrade_230() {
$wpdb->query("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ('$term_id', '$taxonomy', '$description', '$parent', '$count')"); $wpdb->query("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ('$term_id', '$taxonomy', '$description', '$parent', '$count')");
$tt_ids[$term_id][$taxonomy] = (int) $wpdb->insert_id; $tt_ids[$term_id][$taxonomy] = (int) $wpdb->insert_id;
} }
if ( empty($count) ) { if ( empty($count) ) {
$count = 0; $count = 0;
$taxonomy = 'category'; $taxonomy = 'category';
@ -756,15 +756,15 @@ function get_alloptions_110() {
// Version of get_option that is private to install/upgrade. // Version of get_option that is private to install/upgrade.
function __get_option($setting) { function __get_option($setting) {
global $wpdb; global $wpdb;
if ( $setting == 'home' && defined( 'WP_HOME' ) ) { if ( $setting == 'home' && defined( 'WP_HOME' ) ) {
return preg_replace( '|/+$|', '', constant( 'WP_HOME' ) ); return preg_replace( '|/+$|', '', constant( 'WP_HOME' ) );
} }
if ( $setting == 'siteurl' && defined( 'WP_SITEURL' ) ) { if ( $setting == 'siteurl' && defined( 'WP_SITEURL' ) ) {
return preg_replace( '|/+$|', '', constant( 'WP_SITEURL' ) ); return preg_replace( '|/+$|', '', constant( 'WP_SITEURL' ) );
} }
$option = $wpdb->get_var("SELECT option_value FROM $wpdb->options WHERE option_name = '$setting'"); $option = $wpdb->get_var("SELECT option_value FROM $wpdb->options WHERE option_name = '$setting'");
if ( 'home' == $setting && '' == $option ) if ( 'home' == $setting && '' == $option )
@ -1208,7 +1208,7 @@ function wp_check_mysql_version() {
function maybe_disable_automattic_widgets() { function maybe_disable_automattic_widgets() {
$plugins = __get_option( 'active_plugins' ); $plugins = __get_option( 'active_plugins' );
foreach ( (array) $plugins as $plugin ) { foreach ( (array) $plugins as $plugin ) {
if ( basename( $plugin ) == 'widgets.php' ) { if ( basename( $plugin ) == 'widgets.php' ) {
array_splice( $plugins, array_search( $plugin, $plugins ), 1 ); array_splice( $plugins, array_search( $plugin, $plugins ), 1 );

View File

@ -98,7 +98,7 @@ foreach ($categories as $category) {
} else { } else {
$opml = file_get_contents($opml_url); $opml = file_get_contents($opml_url);
} }
include_once('link-parse-opml.php'); include_once('link-parse-opml.php');
$link_count = count($names); $link_count = count($names);

View File

@ -19,48 +19,48 @@ if ( isset( $_POST['comment'] ) && is_array( $_POST['comment'] ) ) {
if ( $action == 'update' ) { if ( $action == 'update' ) {
check_admin_referer( 'moderate-comments' ); check_admin_referer( 'moderate-comments' );
if ( !current_user_can( 'moderate_comments' ) ) { if ( !current_user_can( 'moderate_comments' ) ) {
wp_die( __( 'Your level is not high enough to moderate comments.' ) ); wp_die( __( 'Your level is not high enough to moderate comments.' ) );
} }
$item_ignored = 0; $item_ignored = 0;
$item_deleted = 0; $item_deleted = 0;
$item_approved = 0; $item_approved = 0;
$item_spam = 0; $item_spam = 0;
foreach ( $comment as $k => $v ) { foreach ( $comment as $k => $v ) {
if ( $feelinglucky && $v == 'later' ) { if ( $feelinglucky && $v == 'later' ) {
$v = 'delete'; $v = 'delete';
} }
switch ( $v ) { switch ( $v ) {
case 'later' : case 'later' :
$item_ignored++; $item_ignored++;
break; break;
case 'delete' : case 'delete' :
wp_set_comment_status( $k, 'delete' ); wp_set_comment_status( $k, 'delete' );
$item_deleted++; $item_deleted++;
break; break;
case 'spam' : case 'spam' :
wp_set_comment_status( $k, 'spam' ); wp_set_comment_status( $k, 'spam' );
$item_spam++; $item_spam++;
break; break;
case 'approve' : case 'approve' :
wp_set_comment_status( $k, 'approve' ); wp_set_comment_status( $k, 'approve' );
if ( get_option( 'comments_notify' ) == true ) { if ( get_option( 'comments_notify' ) == true ) {
wp_notify_postauthor( $k ); wp_notify_postauthor( $k );
} }
$item_approved++; $item_approved++;
break; break;
} }
} }
wp_redirect( basename( __FILE__ ) . '?ignored=' . $item_ignored . '&deleted=' . $item_deleted . '&approved=' . $item_approved . '&spam=' . $item_spam ); wp_redirect( basename( __FILE__ ) . '?ignored=' . $item_ignored . '&deleted=' . $item_deleted . '&approved=' . $item_approved . '&spam=' . $item_spam );
exit; exit;
} }
@ -77,25 +77,25 @@ if ( isset( $_GET['approved'] ) || isset( $_GET['deleted'] ) || isset( $_GET['sp
$approved = isset( $_GET['approved'] ) ? (int) $_GET['approved'] : 0; $approved = isset( $_GET['approved'] ) ? (int) $_GET['approved'] : 0;
$deleted = isset( $_GET['deleted'] ) ? (int) $_GET['deleted'] : 0; $deleted = isset( $_GET['deleted'] ) ? (int) $_GET['deleted'] : 0;
$spam = isset( $_GET['ignored'] ) ? (int) $_GET['spam'] : 0; $spam = isset( $_GET['ignored'] ) ? (int) $_GET['spam'] : 0;
if ( $approved > 0 || $deleted > 0 || $spam > 0 ) { if ( $approved > 0 || $deleted > 0 || $spam > 0 ) {
echo '<div id="moderated" class="updated fade"><p>'; echo '<div id="moderated" class="updated fade"><p>';
if ( $approved > 0 ) { if ( $approved > 0 ) {
printf( __ngettext( '%s comment approved.', '%s comments approved.', $approved ), $approved ); printf( __ngettext( '%s comment approved.', '%s comments approved.', $approved ), $approved );
echo '<br />'; echo '<br />';
} }
if ( $deleted > 0 ) { if ( $deleted > 0 ) {
printf( __ngettext( '%s comment deleted', '%s comments deleted.', $deleted ), $deleted ); printf( __ngettext( '%s comment deleted', '%s comments deleted.', $deleted ), $deleted );
echo '<br />'; echo '<br />';
} }
if ( $spam > 0 ) { if ( $spam > 0 ) {
printf( __ngettext( '%s comment marked as spam', '%s comments marked as spam', $spam ), $spam ); printf( __ngettext( '%s comment marked as spam', '%s comments marked as spam', $spam ), $spam );
echo '<br />'; echo '<br />';
} }
echo '</p></div>'; echo '</p></div>';
} }
} }
@ -137,23 +137,23 @@ $comments = array_slice( $comments, $start, $stop );
?> ?>
<h2><?php _e( 'Moderation Queue' ); ?></h2> <h2><?php _e( 'Moderation Queue' ); ?></h2>
<?php <?php
if ( $page_links ) { if ( $page_links ) {
echo '<p class="pagenav">' . $page_links . '</p>'; echo '<p class="pagenav">' . $page_links . '</p>';
} }
?> ?>
<form name="approval" id="approval" action="<?php echo basename( __FILE__ ); ?>" method="post"> <form name="approval" id="approval" action="<?php echo basename( __FILE__ ); ?>" method="post">
<?php wp_nonce_field( 'moderate-comments' ); ?> <?php wp_nonce_field( 'moderate-comments' ); ?>
<input type="hidden" name="action" value="update" /> <input type="hidden" name="action" value="update" />
<ol id="the-comments-list" class="commentlist"> <ol id="the-comments-list" class="commentlist">
<?php <?php
$i = 0; $i = 0;
foreach ( $comments as $comment ) { foreach ( $comments as $comment ) {
$class = 'js-unapproved'; $class = 'js-unapproved';
if ( $i++ % 2 ) { if ( $i++ % 2 ) {
$class .= ' alternate'; $class .= ' alternate';
} }
@ -165,7 +165,7 @@ $comments = array_slice( $comments, $start, $stop );
<?php if ( !empty( $comment->comment_author_url ) && $comment->comment_author_url != 'http://' ) { ?>| <?php comment_author_url_link(); ?> <?php } ?> <?php if ( !empty( $comment->comment_author_url ) && $comment->comment_author_url != 'http://' ) { ?>| <?php comment_author_url_link(); ?> <?php } ?>
| <?php _e( 'IP:' ); ?> <a href="http://ws.arin.net/cgi-bin/whois.pl?queryinput=<?php comment_author_IP(); ?>"><?php comment_author_IP(); ?></a> | <?php _e( 'IP:' ); ?> <a href="http://ws.arin.net/cgi-bin/whois.pl?queryinput=<?php comment_author_IP(); ?>"><?php comment_author_IP(); ?></a>
</p> </p>
<p> <p>
<?php comment_text(); ?> <?php comment_text(); ?>
</p> </p>
@ -189,25 +189,25 @@ $comments = array_slice( $comments, $start, $stop );
} }
?> ?>
</ol> </ol>
<?php <?php
if ( $page_links ) { if ( $page_links ) {
echo '<p class="pagenav">' . $page_links . '</p>'; echo '<p class="pagenav">' . $page_links . '</p>';
} }
?> ?>
<div id="ajax-response"></div> <div id="ajax-response"></div>
<noscript> <noscript>
<p class="submit"> <p class="submit">
<label for="feelinglucky"><input name="feelinglucky" id="feelinglucky" type="checkbox" value="true" /> <?php _e( 'Delete every comment marked &#8220;defer.&#8221; <strong>Warning: This can&#8217;t be undone.</strong>' ); ?></label> <label for="feelinglucky"><input name="feelinglucky" id="feelinglucky" type="checkbox" value="true" /> <?php _e( 'Delete every comment marked &#8220;defer.&#8221; <strong>Warning: This can&#8217;t be undone.</strong>' ); ?></label>
</p> </p>
</noscript> </noscript>
<p class="submit"> <p class="submit">
<input type="submit" id="submit" name="submit" value="<?php _e( 'Bulk Moderate Comments &raquo;' ); ?>" /> <input type="submit" id="submit" name="submit" value="<?php _e( 'Bulk Moderate Comments &raquo;' ); ?>" />
</p> </p>
<script type="text/javascript"> <script type="text/javascript">
// <![CDATA[ // <![CDATA[
function mark_all_as( what ) { function mark_all_as( what ) {
@ -217,7 +217,7 @@ $comments = array_slice( $comments, $start, $stop );
} }
} }
} }
document.write( '<p><strong><?php _e( 'Mark all:' ); ?></strong> <a href="javascript:mark_all_as(\'approve\')"><?php _e( 'Approved' ); ?></a> &ndash; <a href="javascript:mark_all_as(\'spam\')"><?php _e( 'Spam' ); ?></a> &ndash; <a href="javascript:mark_all_as(\'delete\')"><?php _e( 'Deleted' ); ?></a> &ndash; <a href="javascript:mark_all_as(\'later\')"><?php _e( 'Later' ); ?></a></p>' ); document.write( '<p><strong><?php _e( 'Mark all:' ); ?></strong> <a href="javascript:mark_all_as(\'approve\')"><?php _e( 'Approved' ); ?></a> &ndash; <a href="javascript:mark_all_as(\'spam\')"><?php _e( 'Spam' ); ?></a> &ndash; <a href="javascript:mark_all_as(\'delete\')"><?php _e( 'Deleted' ); ?></a> &ndash; <a href="javascript:mark_all_as(\'later\')"><?php _e( 'Later' ); ?></a></p>' );
// ]]> // ]]>
</script> </script>

View File

@ -6,7 +6,7 @@ $parent_file = 'options-general.php';
include('./admin-header.php'); include('./admin-header.php');
?> ?>
<div class="wrap"> <div class="wrap">
<h2><?php _e('General Options') ?></h2> <h2><?php _e('General Options') ?></h2>
<form method="post" action="options.php"> <form method="post" action="options.php">

View File

@ -34,7 +34,7 @@ case 'update':
update_option($option, $value); update_option($option, $value);
} }
} }
$referred = remove_query_arg('updated' , wp_get_referer()); $referred = remove_query_arg('updated' , wp_get_referer());
$goback = add_query_arg('updated', 'true', wp_get_referer()); $goback = add_query_arg('updated', 'true', wp_get_referer());
$goback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $goback); $goback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $goback);

View File

@ -31,12 +31,12 @@ if ( isset($_GET['action']) ) {
} elseif ($_GET['action'] == 'deactivate-all') { } elseif ($_GET['action'] == 'deactivate-all') {
check_admin_referer('deactivate-all'); check_admin_referer('deactivate-all');
$current = get_option('active_plugins'); $current = get_option('active_plugins');
foreach ($current as $plugin) { foreach ($current as $plugin) {
array_splice($current, array_search($plugin, $current), 1); array_splice($current, array_search($plugin, $current), 1);
do_action('deactivate_' . $plugin); do_action('deactivate_' . $plugin);
} }
update_option('active_plugins', array()); update_option('active_plugins', array());
wp_redirect('plugins.php?deactivate-all=true'); wp_redirect('plugins.php?deactivate-all=true');
} }

View File

@ -10,7 +10,7 @@ wp_enqueue_script( 'scriptaculous-dragdrop' );
function wp_widgets_admin_head() { function wp_widgets_admin_head() {
global $wp_registered_sidebars, $wp_registered_widgets, $wp_registered_widget_controls; global $wp_registered_sidebars, $wp_registered_widgets, $wp_registered_widget_controls;
define( 'WP_WIDGETS_WIDTH', 1 + 262 * ( count( $wp_registered_sidebars ) ) ); define( 'WP_WIDGETS_WIDTH', 1 + 262 * ( count( $wp_registered_sidebars ) ) );
define( 'WP_WIDGETS_HEIGHT', 35 * ( count( $wp_registered_widgets ) ) ); define( 'WP_WIDGETS_HEIGHT', 35 * ( count( $wp_registered_widgets ) ) );
?> ?>
@ -30,13 +30,13 @@ function wp_widgets_admin_head() {
<link rel="stylesheet" href="<?php bloginfo( 'wpurl' ); ?>/wp-admin/css/widgets-rtl.css?version=<?php bloginfo('version'); ?>" type="text/css" /> <link rel="stylesheet" href="<?php bloginfo( 'wpurl' ); ?>/wp-admin/css/widgets-rtl.css?version=<?php bloginfo('version'); ?>" type="text/css" />
<?php <?php
} }
$cols = array(); $cols = array();
foreach ( $wp_registered_sidebars as $index => $sidebar ) { foreach ( $wp_registered_sidebars as $index => $sidebar ) {
$cols[] = '\'' . $index . '\''; $cols[] = '\'' . $index . '\'';
} }
$cols = implode( ', ', $cols ); $cols = implode( ', ', $cols );
$widgets = array(); $widgets = array();
foreach ( $wp_registered_widgets as $name => $widget ) { foreach ( $wp_registered_widgets as $name => $widget ) {
$widgets[] = '\'' . $widget['id'] . '\''; $widgets[] = '\'' . $widget['id'] . '\'';
@ -179,19 +179,19 @@ do_action( 'sidebar_admin_setup' );
function wp_widget_draggable( $name ) { function wp_widget_draggable( $name ) {
global $wp_registered_widgets, $wp_registered_widget_controls; global $wp_registered_widgets, $wp_registered_widget_controls;
if ( !isset( $wp_registered_widgets[$name] ) ) { if ( !isset( $wp_registered_widgets[$name] ) ) {
return; return;
} }
$sanitized_name = sanitize_title( $wp_registered_widgets[$name]['id'] ); $sanitized_name = sanitize_title( $wp_registered_widgets[$name]['id'] );
$link_title = __( 'Configure' ); $link_title = __( 'Configure' );
$popper = ( isset( $wp_registered_widget_controls[$name] ) ) $popper = ( isset( $wp_registered_widget_controls[$name] ) )
? ' <div class="popper" id="' . $sanitized_name . 'popper" title="' . $link_title . '">&#8801;</div>' ? ' <div class="popper" id="' . $sanitized_name . 'popper" title="' . $link_title . '">&#8801;</div>'
: ''; : '';
$output = '<li class="module" id="widgetprefix-%1$s"><span class="handle">%2$s</span></li>'; $output = '<li class="module" id="widgetprefix-%1$s"><span class="handle">%2$s</span></li>';
printf( $output, $sanitized_name, $wp_registered_widgets[$name]['name'] . $popper ); printf( $output, $sanitized_name, $wp_registered_widgets[$name]['name'] . $popper );
} }
@ -204,11 +204,11 @@ if ( count( $wp_registered_sidebars ) < 1 ) {
?> ?>
<div class="wrap"> <div class="wrap">
<h2><?php _e( 'No Sidebars Defined' ); ?></h2> <h2><?php _e( 'No Sidebars Defined' ); ?></h2>
<p><?php _e( 'You are seeing this message because the theme you are currently using isn&#8217;t widget-aware, meaning that it has no sidebars that you are able to change. For information on making your theme widget-aware, please <a href="http://automattic.com/code/widgets/themes/">follow these instructions</a>.' ); /* TODO: article on codex */; ?></p> <p><?php _e( 'You are seeing this message because the theme you are currently using isn&#8217;t widget-aware, meaning that it has no sidebars that you are able to change. For information on making your theme widget-aware, please <a href="http://automattic.com/code/widgets/themes/">follow these instructions</a>.' ); /* TODO: article on codex */; ?></p>
</div> </div>
<?php <?php
require_once 'admin-footer.php'; require_once 'admin-footer.php';
exit; exit;
} }
@ -221,23 +221,23 @@ if ( empty( $sidebars_widgets ) ) {
if ( isset( $_POST['action'] ) ) { if ( isset( $_POST['action'] ) ) {
check_admin_referer( 'widgets-save-widget-order' ); check_admin_referer( 'widgets-save-widget-order' );
switch ( $_POST['action'] ) { switch ( $_POST['action'] ) {
case 'default' : case 'default' :
$sidebars_widgets = wp_get_widget_defaults(); $sidebars_widgets = wp_get_widget_defaults();
wp_set_sidebars_widgets( $sidebars_widgets ); wp_set_sidebars_widgets( $sidebars_widgets );
break; break;
case 'save_widget_order' : case 'save_widget_order' :
$sidebars_widgets = array(); $sidebars_widgets = array();
foreach ( $wp_registered_sidebars as $index => $sidebar ) { foreach ( $wp_registered_sidebars as $index => $sidebar ) {
$postindex = $index . 'order'; $postindex = $index . 'order';
parse_str( $_POST[$postindex], $order ); parse_str( $_POST[$postindex], $order );
$new_order = $order[$index]; $new_order = $order[$index];
if ( is_array( $new_order ) ) { if ( is_array( $new_order ) ) {
foreach ( $new_order as $sanitized_name ) { foreach ( $new_order as $sanitized_name ) {
foreach ( $wp_registered_widgets as $name => $widget ) { foreach ( $wp_registered_widgets as $name => $widget ) {
@ -248,7 +248,7 @@ if ( isset( $_POST['action'] ) ) {
} }
} }
} }
wp_set_sidebars_widgets( $sidebars_widgets ); wp_set_sidebars_widgets( $sidebars_widgets );
break; break;
} }
@ -260,14 +260,14 @@ $inactive_widgets = array();
foreach ( $wp_registered_widgets as $name => $widget ) { foreach ( $wp_registered_widgets as $name => $widget ) {
$is_active = false; $is_active = false;
foreach ( $wp_registered_sidebars as $index => $sidebar ) { foreach ( $wp_registered_sidebars as $index => $sidebar ) {
if ( is_array( $sidebars_widgets[$index] ) && in_array( $name, $sidebars_widgets[$index] ) ) { if ( is_array( $sidebars_widgets[$index] ) && in_array( $name, $sidebars_widgets[$index] ) ) {
$is_active = true; $is_active = true;
break; break;
} }
} }
if ( !$is_active ) { if ( !$is_active ) {
$inactive_widgets[] = $name; $inactive_widgets[] = $name;
} }
@ -297,9 +297,9 @@ if ( isset( $_POST['action'] ) ) {
?> ?>
<div class="wrap"> <div class="wrap">
<h2><?php _e( 'Sidebar Arrangement' ); ?></h2> <h2><?php _e( 'Sidebar Arrangement' ); ?></h2>
<p><?php _e( 'You can drag and drop widgets onto your sidebar below.' ); ?></p> <p><?php _e( 'You can drag and drop widgets onto your sidebar below.' ); ?></p>
<form id="sbadmin" method="post" onsubmit="serializeAll();"> <form id="sbadmin" method="post" onsubmit="serializeAll();">
<p class="submit"> <p class="submit">
<input type="submit" value="<?php _e( 'Save Changes &raquo;' ); ?>" /> <input type="submit" value="<?php _e( 'Save Changes &raquo;' ); ?>" />
@ -309,17 +309,17 @@ if ( isset( $_POST['action'] ) ) {
foreach ( $wp_registered_sidebars as $index => $sidebar ) { foreach ( $wp_registered_sidebars as $index => $sidebar ) {
?> ?>
<input type="hidden" id="<?php echo $index; ?>order" name="<?php echo $index; ?>order" value="" /> <input type="hidden" id="<?php echo $index; ?>order" name="<?php echo $index; ?>order" value="" />
<div class="dropzone"> <div class="dropzone">
<h3><?php echo $sidebar['name']; ?></h3> <h3><?php echo $sidebar['name']; ?></h3>
<div id="<?php echo $index; ?>placematt" class="module placemat"> <div id="<?php echo $index; ?>placematt" class="module placemat">
<span class="handle"> <span class="handle">
<h4><?php _e( 'Default Sidebar' ); ?></h4> <h4><?php _e( 'Default Sidebar' ); ?></h4>
<?php _e( 'Your theme will display its usual sidebar when this box is empty. Dragging widgets into this box will replace the usual sidebar with your customized sidebar.' ); ?> <?php _e( 'Your theme will display its usual sidebar when this box is empty. Dragging widgets into this box will replace the usual sidebar with your customized sidebar.' ); ?>
</span> </span>
</div> </div>
<ul id="<?php echo $index; ?>"> <ul id="<?php echo $index; ?>">
<?php <?php
if ( is_array( $sidebars_widgets[$index] ) ) { if ( is_array( $sidebars_widgets[$index] ) ) {
@ -333,14 +333,14 @@ if ( isset( $_POST['action'] ) ) {
<?php <?php
} }
?> ?>
<br class="clear" /> <br class="clear" />
</div> </div>
<div id="palettediv"> <div id="palettediv">
<h3><?php _e( 'Available Widgets' ); ?></h3> <h3><?php _e( 'Available Widgets' ); ?></h3>
<ul id="palette"> <ul id="palette">
<?php <?php
foreach ( $inactive_widgets as $name ) { foreach ( $inactive_widgets as $name ) {
@ -350,7 +350,7 @@ if ( isset( $_POST['action'] ) ) {
<li id="lastmodule"><span></span></li> <li id="lastmodule"><span></span></li>
</ul> </ul>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
// <![CDATA[ // <![CDATA[
<?php foreach ( $containers as $container ) { ?> <?php foreach ( $containers as $container ) { ?>
@ -362,13 +362,13 @@ if ( isset( $_POST['action'] ) ) {
<?php } ?> <?php } ?>
// ]]> // ]]>
</script> </script>
<p class="submit"> <p class="submit">
<?php wp_nonce_field( 'widgets-save-widget-order' ); ?> <?php wp_nonce_field( 'widgets-save-widget-order' ); ?>
<input type="hidden" name="action" id="action" value="save_widget_order" /> <input type="hidden" name="action" id="action" value="save_widget_order" />
<input type="submit" value="<?php _e( 'Save Changes &raquo;' ); ?>" /> <input type="submit" value="<?php _e( 'Save Changes &raquo;' ); ?>" />
</p> </p>
<div id="controls"> <div id="controls">
<?php foreach ( $wp_registered_widget_controls as $name => $widget ) { ?> <?php foreach ( $wp_registered_widget_controls as $name => $widget ) { ?>
<div class="hidden" id="<?php echo $widget['id']; ?>control"> <div class="hidden" id="<?php echo $widget['id']; ?>control">
@ -381,12 +381,12 @@ if ( isset( $_POST['action'] ) ) {
<?php } ?> <?php } ?>
</div> </div>
</form> </form>
<br class="clear" /> <br class="clear" />
</div> </div>
<div id="shadow"> </div> <div id="shadow"> </div>
<?php do_action( 'sidebar_admin_page' ); ?> <?php do_action( 'sidebar_admin_page' ); ?>
<?php require_once 'admin-footer.php'; ?> <?php require_once 'admin-footer.php'; ?>

View File

@ -109,7 +109,7 @@ class AtomParser {
$fp = fopen("php://input", "r"); $fp = fopen("php://input", "r");
while(!feof($fp)) { while(!feof($fp)) {
$line = fgets($fp, 4096); $line = fgets($fp, 4096);
if($app_logging) $contents .= $line; if($app_logging) $contents .= $line;
if(!xml_parse($parser, $line)) { if(!xml_parse($parser, $line)) {
@ -162,7 +162,7 @@ class AtomParser {
if(count($this->in_content) == 2) { if(count($this->in_content) == 2) {
array_push($this->in_content, ">"); array_push($this->in_content, ">");
} }
array_push($this->in_content, "<". $this->ns_to_prefix($name) ."{$xmlns_str}{$attrs_str}"); array_push($this->in_content, "<". $this->ns_to_prefix($name) ."{$xmlns_str}{$attrs_str}");
} else if(in_array($tag, $this->ATOM_CONTENT_ELEMENTS) || in_array($tag, $this->ATOM_SIMPLE_ELEMENTS)) { } else if(in_array($tag, $this->ATOM_CONTENT_ELEMENTS) || in_array($tag, $this->ATOM_SIMPLE_ELEMENTS)) {
$this->in_content = array(); $this->in_content = array();

View File

@ -1,11 +1,11 @@
<?php <?php
$img = 'kubrickheader.jpg'; $img = 'kubrickheader.jpg';
// If we don't have image processing support, redirect. // If we don't have image processing support, redirect.
if ( ! function_exists('imagecreatefromjpeg') ) if ( ! function_exists('imagecreatefromjpeg') )
die(header("Location: kubrickheader.jpg")); die(header("Location: kubrickheader.jpg"));
// Assign and validate the color values // Assign and validate the color values
$default = false; $default = false;
$vars = array('upper'=>array('r1', 'g1', 'b1'), 'lower'=>array('r2', 'g2', 'b2')); $vars = array('upper'=>array('r1', 'g1', 'b1'), 'lower'=>array('r2', 'g2', 'b2'));
@ -23,17 +23,17 @@ foreach ( $vars as $var => $subvars ) {
$default = true; $default = true;
} }
} }
if ( $default ) if ( $default )
list ( $r1, $g1, $b1, $r2, $g2, $b2 ) = array ( 105, 174, 231, 65, 128, 182 ); list ( $r1, $g1, $b1, $r2, $g2, $b2 ) = array ( 105, 174, 231, 65, 128, 182 );
// Create the image // Create the image
$im = imagecreatefromjpeg($img); $im = imagecreatefromjpeg($img);
// Get the background color, define the rectangle height // Get the background color, define the rectangle height
$white = imagecolorat( $im, 15, 15 ); $white = imagecolorat( $im, 15, 15 );
$h = 182; $h = 182;
// Define the boundaries of the rounded edges ( y => array ( x1, x2 ) ) // Define the boundaries of the rounded edges ( y => array ( x1, x2 ) )
$corners = array( $corners = array(
0 => array ( 25, 734 ), 0 => array ( 25, 734 ),
@ -47,14 +47,14 @@ $corners = array(
180 => array ( 23, 736 ), 180 => array ( 23, 736 ),
181 => array ( 25, 734 ), 181 => array ( 25, 734 ),
); );
// Blank out the blue thing // Blank out the blue thing
for ( $i = 0; $i < $h; $i++ ) { for ( $i = 0; $i < $h; $i++ ) {
$x1 = 19; $x1 = 19;
$x2 = 740; $x2 = 740;
imageline( $im, $x1, 18 + $i, $x2, 18 + $i, $white ); imageline( $im, $x1, 18 + $i, $x2, 18 + $i, $white );
} }
// Draw a new color thing // Draw a new color thing
for ( $i = 0; $i < $h; $i++ ) { for ( $i = 0; $i < $h; $i++ ) {
$x1 = 20; $x1 = 20;
@ -69,7 +69,7 @@ for ( $i = 0; $i < $h; $i++ ) {
} }
imageline( $im, $x1, 18 + $i, $x2, 18 + $i, $color ); imageline( $im, $x1, 18 + $i, $x2, 18 + $i, $color );
} }
//die; //die;
header("Content-Type: image/jpeg"); header("Content-Type: image/jpeg");
imagejpeg($im, '', 92); imagejpeg($im, '', 92);

View File

@ -40,7 +40,7 @@
<p>You are currently browsing the <a href="<?php echo bloginfo('url'); ?>/"><?php echo bloginfo('name'); ?></a> weblog archives.</p> <p>You are currently browsing the <a href="<?php echo bloginfo('url'); ?>/"><?php echo bloginfo('name'); ?></a> weblog archives.</p>
<?php } ?> <?php } ?>
</li> <?php }?> </li> <?php }?>
<?php wp_list_pages('title_li=<h2>Pages</h2>' ); ?> <?php wp_list_pages('title_li=<h2>Pages</h2>' ); ?>
@ -67,7 +67,7 @@
</ul> </ul>
</li> </li>
<?php } ?> <?php } ?>
<?php endif; ?> <?php endif; ?>
</ul> </ul>
</div> </div>

View File

@ -362,7 +362,7 @@ function get_author_name( $auth_id ) {
*/ */
function wp_list_authors($args = '') { function wp_list_authors($args = '') {
global $wpdb; global $wpdb;
$defaults = array( $defaults = array(
'optioncount' => false, 'exclude_admin' => true, 'optioncount' => false, 'exclude_admin' => true,
'show_fullname' => false, 'hide_empty' => true, 'show_fullname' => false, 'hide_empty' => true,

View File

@ -9,12 +9,12 @@
**/ **/
function wp_get_links($args = '') { function wp_get_links($args = '') {
global $wpdb; global $wpdb;
if ( strpos( $args, '=' ) === false ) { if ( strpos( $args, '=' ) === false ) {
$cat_id = $args; $cat_id = $args;
$args = add_query_arg( 'category', $cat_id, $args ); $args = add_query_arg( 'category', $cat_id, $args );
} }
$defaults = array( $defaults = array(
'category' => -1, 'before' => '', 'category' => -1, 'before' => '',
'after' => '<br />', 'between' => ' ', 'after' => '<br />', 'between' => ' ',
@ -23,7 +23,7 @@ function wp_get_links($args = '') {
'limit' => -1, 'show_updated' => true, 'limit' => -1, 'show_updated' => true,
'echo' => true 'echo' => true
); );
$r = wp_parse_args( $args, $defaults ); $r = wp_parse_args( $args, $defaults );
extract( $r ); extract( $r );
@ -131,7 +131,7 @@ function get_links($category = -1,
if ( $show_description && '' != $desc ) if ( $show_description && '' != $desc )
$output .= $between . $desc; $output .= $between . $desc;
if ($show_rating) { if ($show_rating) {
$output .= $between . get_linkrating($row); $output .= $between . get_linkrating($row);
} }
@ -245,7 +245,7 @@ function _walk_bookmarks($bookmarks, $args = '' ) {
'show_images' => 1, 'before' => '<li>', 'show_images' => 1, 'before' => '<li>',
'after' => '</li>', 'between' => "\n" 'after' => '</li>', 'between' => "\n"
); );
$r = wp_parse_args( $args, $defaults ); $r = wp_parse_args( $args, $defaults );
extract( $r ); extract( $r );
@ -302,11 +302,11 @@ function _walk_bookmarks($bookmarks, $args = '' ) {
if ( $show_description && '' != $desc ) if ( $show_description && '' != $desc )
$output .= $between . $desc; $output .= $between . $desc;
if ($show_rating) { if ($show_rating) {
$output .= $between . get_linkrating($bookmark); $output .= $between . get_linkrating($bookmark);
} }
$output .= "$after\n"; $output .= "$after\n";
} // end while } // end while
@ -325,7 +325,7 @@ function wp_list_bookmarks($args = '') {
'class' => 'linkcat', 'category_before' => '<li id="%id" class="%class">', 'class' => 'linkcat', 'category_before' => '<li id="%id" class="%class">',
'category_after' => '</li>' 'category_after' => '</li>'
); );
$r = wp_parse_args( $args, $defaults ); $r = wp_parse_args( $args, $defaults );
extract( $r ); extract( $r );

View File

@ -25,7 +25,7 @@ function get_link($bookmark_id, $output = OBJECT) {
function get_bookmarks($args = '') { function get_bookmarks($args = '') {
global $wpdb; global $wpdb;
$defaults = array( $defaults = array(
'orderby' => 'name', 'order' => 'ASC', 'orderby' => 'name', 'order' => 'ASC',
'limit' => -1, 'category' => '', 'limit' => -1, 'category' => '',
@ -33,7 +33,7 @@ function get_bookmarks($args = '') {
'show_updated' => 0, 'include' => '', 'show_updated' => 0, 'include' => '',
'exclude' => '' 'exclude' => ''
); );
$r = wp_parse_args( $args, $defaults ); $r = wp_parse_args( $args, $defaults );
extract( $r ); extract( $r );

View File

@ -186,9 +186,9 @@ function wp_dropdown_categories($args = '') {
'selected' => 0, 'hierarchical' => 0, 'selected' => 0, 'hierarchical' => 0,
'name' => 'cat', 'class' => 'postform' 'name' => 'cat', 'class' => 'postform'
); );
$defaults['selected'] = ( is_category() ) ? get_query_var('cat') : 0; $defaults['selected'] = ( is_category() ) ? get_query_var('cat') : 0;
$r = wp_parse_args( $args, $defaults ); $r = wp_parse_args( $args, $defaults );
$r['include_last_update_time'] = $r['show_last_update']; $r['include_last_update_time'] = $r['show_last_update'];
extract( $r ); extract( $r );
@ -236,19 +236,19 @@ function wp_list_categories($args = '') {
'feed_image' => '', 'exclude' => '', 'feed_image' => '', 'exclude' => '',
'hierarchical' => true, 'title_li' => __('Categories') 'hierarchical' => true, 'title_li' => __('Categories')
); );
$r = wp_parse_args( $args, $defaults ); $r = wp_parse_args( $args, $defaults );
if ( !isset( $r['pad_counts'] ) && $r['show_count'] && $r['hierarchical'] ) { if ( !isset( $r['pad_counts'] ) && $r['show_count'] && $r['hierarchical'] ) {
$r['pad_counts'] = true; $r['pad_counts'] = true;
} }
if ( isset( $r['show_date'] ) ) { if ( isset( $r['show_date'] ) ) {
$r['include_last_update_time'] = $r['show_date']; $r['include_last_update_time'] = $r['show_date'];
} }
extract( $r ); extract( $r );
$categories = get_categories($r); $categories = get_categories($r);
$output = ''; $output = '';
@ -262,13 +262,13 @@ function wp_list_categories($args = '') {
$output .= __("No categories"); $output .= __("No categories");
} else { } else {
global $wp_query; global $wp_query;
if( !empty($show_option_all) ) if( !empty($show_option_all) )
if ('list' == $style ) if ('list' == $style )
$output .= '<li><a href="' . get_bloginfo('url') . '">' . $show_option_all . '</a></li>'; $output .= '<li><a href="' . get_bloginfo('url') . '">' . $show_option_all . '</a></li>';
else else
$output .= '<a href="' . get_bloginfo('url') . '">' . $show_option_all . '</a>'; $output .= '<a href="' . get_bloginfo('url') . '">' . $show_option_all . '</a>';
if ( is_category() ) if ( is_category() )
$r['current_category'] = $wp_query->get_queried_object_id(); $r['current_category'] = $wp_query->get_queried_object_id();
@ -409,12 +409,12 @@ function get_tag_link( $tag_id ) {
function get_the_tags( $id = 0 ) { function get_the_tags( $id = 0 ) {
global $post; global $post;
$id = (int) $id; $id = (int) $id;
if ( ! $id && ! in_the_loop() ) if ( ! $id && ! in_the_loop() )
return false; // in-the-loop function return false; // in-the-loop function
if ( !$id ) if ( !$id )
$id = (int) $post->ID; $id = (int) $post->ID;
@ -433,7 +433,7 @@ function the_tags( $before = 'Tags: ', $sep = ', ', $after = '' ) {
if ( empty( $tags ) ) if ( empty( $tags ) )
return false; return false;
$tag_list = $before; $tag_list = $before;
foreach ( $tags as $tag ) foreach ( $tags as $tag )
$tag_links[] = '<a href="' . get_tag_link($tag->term_id) . '" rel="tag">' . $tag->slug . '</a>'; $tag_links[] = '<a href="' . get_tag_link($tag->term_id) . '" rel="tag">' . $tag->slug . '</a>';

View File

@ -47,7 +47,7 @@ class IXR_Value {
} }
// If it is a normal PHP object convert it in to a struct // If it is a normal PHP object convert it in to a struct
if (is_object($this->data)) { if (is_object($this->data)) {
$this->data = get_object_vars($this->data); $this->data = get_object_vars($this->data);
return 'struct'; return 'struct';
} }

View File

@ -113,7 +113,7 @@ class PHPMailer
* @var string * @var string
*/ */
var $Sendmail = "/usr/sbin/sendmail"; var $Sendmail = "/usr/sbin/sendmail";
/** /**
* Path to PHPMailer plugins. This is now only useful if the SMTP class * Path to PHPMailer plugins. This is now only useful if the SMTP class
* is in a different directory than the PHP include path. * is in a different directory than the PHP include path.
@ -222,7 +222,7 @@ class PHPMailer
var $error_count = 0; var $error_count = 0;
var $LE = "\n"; var $LE = "\n";
/**#@-*/ /**#@-*/
///////////////////////////////////////////////// /////////////////////////////////////////////////
// VARIABLE METHODS // VARIABLE METHODS
///////////////////////////////////////////////// /////////////////////////////////////////////////
@ -382,7 +382,7 @@ class PHPMailer
return $result; return $result;
} }
/** /**
* Sends mail using the $Sendmail program. * Sends mail using the $Sendmail program.
* @access private * @access private
@ -402,7 +402,7 @@ class PHPMailer
fputs($mail, $header); fputs($mail, $header);
fputs($mail, $body); fputs($mail, $body);
$result = pclose($mail) >> 8 & 0xFF; $result = pclose($mail) >> 8 & 0xFF;
if($result != 0) if($result != 0)
{ {
@ -548,7 +548,7 @@ class PHPMailer
$this->smtp->Hello($this->Helo); $this->smtp->Hello($this->Helo);
else else
$this->smtp->Hello($this->ServerHostname()); $this->smtp->Hello($this->ServerHostname());
if($this->SMTPAuth) if($this->SMTPAuth)
{ {
if(!$this->smtp->Authenticate($this->Username, if(!$this->smtp->Authenticate($this->Username,
@ -604,7 +604,7 @@ class PHPMailer
return false; return false;
} }
$this->language = $PHPMAILER_LANG; $this->language = $PHPMAILER_LANG;
return true; return true;
} }
@ -629,7 +629,7 @@ class PHPMailer
return $addr_str; return $addr_str;
} }
/** /**
* Formats an address correctly. * Formats an address correctly.
* @access private * @access private
@ -726,7 +726,7 @@ class PHPMailer
return $message; return $message;
} }
/** /**
* Set the body wrapping. * Set the body wrapping.
* @access private * @access private
@ -735,7 +735,7 @@ class PHPMailer
function SetWordWrap() { function SetWordWrap() {
if($this->WordWrap < 1) if($this->WordWrap < 1)
return; return;
switch($this->message_type) switch($this->message_type)
{ {
case "alt": case "alt":
@ -756,7 +756,7 @@ class PHPMailer
*/ */
function CreateHeader() { function CreateHeader() {
$result = ""; $result = "";
// Set the boundaries // Set the boundaries
$uniq_id = md5(uniqid(time())); $uniq_id = md5(uniqid(time()));
$this->boundary[1] = "b1_" . $uniq_id; $this->boundary[1] = "b1_" . $uniq_id;
@ -767,7 +767,7 @@ class PHPMailer
$result .= $this->HeaderLine("Return-Path", trim($this->From)); $result .= $this->HeaderLine("Return-Path", trim($this->From));
else else
$result .= $this->HeaderLine("Return-Path", trim($this->Sender)); $result .= $this->HeaderLine("Return-Path", trim($this->Sender));
// To be created automatically by mail() // To be created automatically by mail()
if($this->Mailer != "mail") if($this->Mailer != "mail")
{ {
@ -797,7 +797,7 @@ class PHPMailer
$result .= sprintf("Message-ID: <%s@%s>%s", $uniq_id, $this->ServerHostname(), $this->LE); $result .= sprintf("Message-ID: <%s@%s>%s", $uniq_id, $this->ServerHostname(), $this->LE);
$result .= $this->HeaderLine("X-Priority", $this->Priority); $result .= $this->HeaderLine("X-Priority", $this->Priority);
if($this->ConfirmReadingTo != "") if($this->ConfirmReadingTo != "")
{ {
$result .= $this->HeaderLine("Disposition-Notification-To", $result .= $this->HeaderLine("Disposition-Notification-To",
@ -865,10 +865,10 @@ class PHPMailer
$result .= $this->LE.$this->LE; $result .= $this->LE.$this->LE;
$result .= $this->GetBoundary($this->boundary[1], "", $result .= $this->GetBoundary($this->boundary[1], "",
"text/html", ""); "text/html", "");
$result .= $this->EncodeString($this->Body, $this->Encoding); $result .= $this->EncodeString($this->Body, $this->Encoding);
$result .= $this->LE.$this->LE; $result .= $this->LE.$this->LE;
$result .= $this->EndBoundary($this->boundary[1]); $result .= $this->EndBoundary($this->boundary[1]);
break; break;
case "plain": case "plain":
@ -878,7 +878,7 @@ class PHPMailer
$result .= $this->GetBoundary($this->boundary[1], "", "", ""); $result .= $this->GetBoundary($this->boundary[1], "", "", "");
$result .= $this->EncodeString($this->Body, $this->Encoding); $result .= $this->EncodeString($this->Body, $this->Encoding);
$result .= $this->LE; $result .= $this->LE;
$result .= $this->AttachAll(); $result .= $this->AttachAll();
break; break;
case "alt_attachments": case "alt_attachments":
@ -887,23 +887,23 @@ class PHPMailer
"\tboundary=\"%s\"%s", "\tboundary=\"%s\"%s",
"multipart/alternative", $this->LE, "multipart/alternative", $this->LE,
$this->boundary[2], $this->LE.$this->LE); $this->boundary[2], $this->LE.$this->LE);
// Create text body // Create text body
$result .= $this->GetBoundary($this->boundary[2], "", $result .= $this->GetBoundary($this->boundary[2], "",
"text/plain", "") . $this->LE; "text/plain", "") . $this->LE;
$result .= $this->EncodeString($this->AltBody, $this->Encoding); $result .= $this->EncodeString($this->AltBody, $this->Encoding);
$result .= $this->LE.$this->LE; $result .= $this->LE.$this->LE;
// Create the HTML body // Create the HTML body
$result .= $this->GetBoundary($this->boundary[2], "", $result .= $this->GetBoundary($this->boundary[2], "",
"text/html", "") . $this->LE; "text/html", "") . $this->LE;
$result .= $this->EncodeString($this->Body, $this->Encoding); $result .= $this->EncodeString($this->Body, $this->Encoding);
$result .= $this->LE.$this->LE; $result .= $this->LE.$this->LE;
$result .= $this->EndBoundary($this->boundary[2]); $result .= $this->EndBoundary($this->boundary[2]);
$result .= $this->AttachAll(); $result .= $this->AttachAll();
break; break;
} }
@ -929,10 +929,10 @@ class PHPMailer
$result .= $this->LE; $result .= $this->LE;
$result .= $this->HeaderLine("Content-Transfer-Encoding", $encoding); $result .= $this->HeaderLine("Content-Transfer-Encoding", $encoding);
$result .= $this->LE; $result .= $this->LE;
return $result; return $result;
} }
/** /**
* Returns the end of a message boundary. * Returns the end of a message boundary.
* @access private * @access private
@ -940,7 +940,7 @@ class PHPMailer
function EndBoundary($boundary) { function EndBoundary($boundary) {
return $this->LE . "--" . $boundary . "--" . $this->LE; return $this->LE . "--" . $boundary . "--" . $this->LE;
} }
/** /**
* Sets the message type. * Sets the message type.
* @access private * @access private
@ -1043,7 +1043,7 @@ class PHPMailer
$type = $this->attachment[$i][4]; $type = $this->attachment[$i][4];
$disposition = $this->attachment[$i][6]; $disposition = $this->attachment[$i][6];
$cid = $this->attachment[$i][7]; $cid = $this->attachment[$i][7];
$mime[] = sprintf("--%s%s", $this->boundary[1], $this->LE); $mime[] = sprintf("--%s%s", $this->boundary[1], $this->LE);
$mime[] = sprintf("Content-Type: %s; name=\"%s\"%s", $type, $name, $this->LE); $mime[] = sprintf("Content-Type: %s; name=\"%s\"%s", $type, $name, $this->LE);
$mime[] = sprintf("Content-Transfer-Encoding: %s%s", $encoding, $this->LE); $mime[] = sprintf("Content-Transfer-Encoding: %s%s", $encoding, $this->LE);
@ -1073,7 +1073,7 @@ class PHPMailer
return join("", $mime); return join("", $mime);
} }
/** /**
* Encodes attachment in requested format. Returns an * Encodes attachment in requested format. Returns an
* empty string on failure. * empty string on failure.
@ -1135,7 +1135,7 @@ class PHPMailer
*/ */
function EncodeHeader ($str, $position = 'text') { function EncodeHeader ($str, $position = 'text') {
$x = 0; $x = 0;
switch (strtolower($position)) { switch (strtolower($position)) {
case 'phrase': case 'phrase':
if (!preg_match('/[\200-\377]/', $str)) { if (!preg_match('/[\200-\377]/', $str)) {
@ -1177,10 +1177,10 @@ class PHPMailer
$encoded = preg_replace('/^(.*)$/m', " =?".$this->CharSet."?$encoding?\\1?=", $encoded); $encoded = preg_replace('/^(.*)$/m', " =?".$this->CharSet."?$encoding?\\1?=", $encoded);
$encoded = trim(str_replace("\n", $this->LE, $encoded)); $encoded = trim(str_replace("\n", $this->LE, $encoded));
return $encoded; return $encoded;
} }
/** /**
* Encode string to quoted-printable. * Encode string to quoted-printable.
* @access private * @access private
@ -1226,7 +1226,7 @@ class PHPMailer
"'='.sprintf('%02X', ord('\\1'))", $encoded); "'='.sprintf('%02X', ord('\\1'))", $encoded);
break; break;
} }
// Replace every spaces to _ (more readable than =20) // Replace every spaces to _ (more readable than =20)
$encoded = str_replace(" ", "_", $encoded); $encoded = str_replace(" ", "_", $encoded);
@ -1256,7 +1256,7 @@ class PHPMailer
$this->attachment[$cur][6] = "attachment"; $this->attachment[$cur][6] = "attachment";
$this->attachment[$cur][7] = 0; $this->attachment[$cur][7] = 0;
} }
/** /**
* Adds an embedded attachment. This can include images, sounds, and * Adds an embedded attachment. This can include images, sounds, and
* just about any other document. Make sure to set the $type to an * just about any other document. Make sure to set the $type to an
@ -1272,7 +1272,7 @@ class PHPMailer
*/ */
function AddEmbeddedImage($path, $cid, $name = "", $encoding = "base64", function AddEmbeddedImage($path, $cid, $name = "", $encoding = "base64",
$type = "application/octet-stream") { $type = "application/octet-stream") {
if(!@is_file($path)) if(!@is_file($path))
{ {
$this->SetError($this->Lang("file_access") . $path); $this->SetError($this->Lang("file_access") . $path);
@ -1293,10 +1293,10 @@ class PHPMailer
$this->attachment[$cur][5] = false; // isStringAttachment $this->attachment[$cur][5] = false; // isStringAttachment
$this->attachment[$cur][6] = "inline"; $this->attachment[$cur][6] = "inline";
$this->attachment[$cur][7] = $cid; $this->attachment[$cur][7] = $cid;
return true; return true;
} }
/** /**
* Returns true if an inline attachment is present. * Returns true if an inline attachment is present.
* @access private * @access private
@ -1312,7 +1312,7 @@ class PHPMailer
break; break;
} }
} }
return $result; return $result;
} }
@ -1410,7 +1410,7 @@ class PHPMailer
return $result; return $result;
} }
/** /**
* Returns the appropriate server variable. Should work with both * Returns the appropriate server variable. Should work with both
* PHP 4.1.0+ as well as older versions. Returns an empty string * PHP 4.1.0+ as well as older versions. Returns an empty string
@ -1428,7 +1428,7 @@ class PHPMailer
if(!isset($_SERVER["REMOTE_ADDR"])) if(!isset($_SERVER["REMOTE_ADDR"]))
$_SERVER = $HTTP_ENV_VARS; // must be Apache $_SERVER = $HTTP_ENV_VARS; // must be Apache
} }
if(isset($_SERVER[$varName])) if(isset($_SERVER[$varName]))
return $_SERVER[$varName]; return $_SERVER[$varName];
else else
@ -1459,13 +1459,13 @@ class PHPMailer
function Lang($key) { function Lang($key) {
if(count($this->language) < 1) if(count($this->language) < 1)
$this->SetLanguage("en"); // set the default language $this->SetLanguage("en"); // set the default language
if(isset($this->language[$key])) if(isset($this->language[$key]))
return $this->language[$key]; return $this->language[$key];
else else
return "Language string failed to load: " . $key; return "Language string failed to load: " . $key;
} }
/** /**
* Returns true if an error occurred. * Returns true if an error occurred.
* @return bool * @return bool

View File

@ -28,13 +28,13 @@ class SMTP
* @var int * @var int
*/ */
var $SMTP_PORT = 25; var $SMTP_PORT = 25;
/** /**
* SMTP reply line ending * SMTP reply line ending
* @var string * @var string
*/ */
var $CRLF = "\r\n"; var $CRLF = "\r\n";
/** /**
* Sets whether debugging is turned on * Sets whether debugging is turned on
* @var bool * @var bool
@ -508,7 +508,7 @@ class SMTP
} }
$this->helo_rply = $rply; $this->helo_rply = $rply;
return true; return true;
} }

View File

@ -692,7 +692,7 @@ class WP_Ajax_Response {
'id' => '0', 'old_id' => false, 'id' => '0', 'old_id' => false,
'data' => '', 'supplemental' => array() 'data' => '', 'supplemental' => array()
); );
$r = wp_parse_args( $args, $defaults ); $r = wp_parse_args( $args, $defaults );
extract( $r ); extract( $r );

View File

@ -83,7 +83,7 @@ function spawn_cron() {
$cron_url = get_option( 'siteurl' ) . '/wp-cron.php'; $cron_url = get_option( 'siteurl' ) . '/wp-cron.php';
$parts = parse_url( $cron_url ); $parts = parse_url( $cron_url );
if ($parts['scheme'] == 'https') { if ($parts['scheme'] == 'https') {
// support for SSL was added in 4.3.0 // support for SSL was added in 4.3.0
if (version_compare(phpversion(), '4.3.0', '>=') && function_exists('openssl_open')) { if (version_compare(phpversion(), '4.3.0', '>=') && function_exists('openssl_open')) {
@ -94,7 +94,7 @@ function spawn_cron() {
} else { } else {
$argyle = @ fsockopen( $parts['host'], $_SERVER['SERVER_PORT'], $errno, $errstr, 0.01 ); $argyle = @ fsockopen( $parts['host'], $_SERVER['SERVER_PORT'], $errno, $errstr, 0.01 );
} }
if ( $argyle ) if ( $argyle )
fputs( $argyle, fputs( $argyle,
"GET {$parts['path']}?check=" . wp_hash('187425') . " HTTP/1.0\r\n" "GET {$parts['path']}?check=" . wp_hash('187425') . " HTTP/1.0\r\n"

View File

@ -1085,7 +1085,7 @@ function clean_url( $url, $protocols = null ) {
if ( strpos($url, '://') === false && if ( strpos($url, '://') === false &&
substr( $url, 0, 1 ) != '/' && !preg_match('/^[a-z0-9-]+?\.php/i', $url) ) substr( $url, 0, 1 ) != '/' && !preg_match('/^[a-z0-9-]+?\.php/i', $url) )
$url = 'http://' . $url; $url = 'http://' . $url;
$url = preg_replace('/&([^#])(?![a-z]{2,8};)/', '&#038;$1', $url); $url = preg_replace('/&([^#])(?![a-z]{2,8};)/', '&#038;$1', $url);
if ( !is_array($protocols) ) if ( !is_array($protocols) )
$protocols = array('http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet'); $protocols = array('http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet');

View File

@ -706,9 +706,9 @@ function wp($query_vars = '') {
function get_status_header_desc( $code ) { function get_status_header_desc( $code ) {
global $wp_header_to_desc; global $wp_header_to_desc;
$code = (int) $code; $code = (int) $code;
if ( isset( $wp_header_to_desc[$code] ) ) { if ( isset( $wp_header_to_desc[$code] ) ) {
return $wp_header_to_desc[$code]; return $wp_header_to_desc[$code];
} else { } else {
@ -718,7 +718,7 @@ function get_status_header_desc( $code ) {
function status_header( $header ) { function status_header( $header ) {
$text = get_status_header_desc( $header ); $text = get_status_header_desc( $header );
if ( empty( $text ) ) if ( empty( $text ) )
return false; return false;
@ -1296,7 +1296,7 @@ function wp_parse_args( $args, $defaults = '' ) {
$r = stripslashes_deep( $r ); $r = stripslashes_deep( $r );
} }
} }
if ( is_array( $defaults ) ) { if ( is_array( $defaults ) ) {
return array_merge( $defaults, $r ); return array_merge( $defaults, $r );
} else { } else {

View File

@ -61,7 +61,7 @@ function wp_meta() {
function bloginfo($show='') { function bloginfo($show='') {
$info = get_bloginfo($show); $info = get_bloginfo($show);
// Don't filter URL's. // Don't filter URL's.
if (strpos($show, 'url') === false && if (strpos($show, 'url') === false &&
strpos($show, 'directory') === false && strpos($show, 'directory') === false &&
@ -322,13 +322,13 @@ function get_archives_link($url, $text, $format = 'html', $before = '', $after =
function wp_get_archives($args = '') { function wp_get_archives($args = '') {
global $wpdb, $wp_locale; global $wpdb, $wp_locale;
$defaults = array( $defaults = array(
'type' => 'monthly', 'limit' => '', 'type' => 'monthly', 'limit' => '',
'format' => 'html', 'before' => '', 'format' => 'html', 'before' => '',
'after' => '', 'show_post_count' => false 'after' => '', 'show_post_count' => false
); );
$r = wp_parse_args( $args, $defaults ); $r = wp_parse_args( $args, $defaults );
extract( $r ); extract( $r );
@ -593,10 +593,10 @@ function get_calendar($initial = true) {
); );
if ( $ak_post_titles ) { if ( $ak_post_titles ) {
foreach ( $ak_post_titles as $ak_post_title ) { foreach ( $ak_post_titles as $ak_post_title ) {
$post_title = apply_filters( "the_title", $ak_post_title->post_title ); $post_title = apply_filters( "the_title", $ak_post_title->post_title );
$post_title = str_replace('"', '&quot;', wptexturize( $post_title )); $post_title = str_replace('"', '&quot;', wptexturize( $post_title ));
if ( empty($ak_titles_for_day['day_'.$ak_post_title->dom]) ) if ( empty($ak_titles_for_day['day_'.$ak_post_title->dom]) )
$ak_titles_for_day['day_'.$ak_post_title->dom] = ''; $ak_titles_for_day['day_'.$ak_post_title->dom] = '';
if ( empty($ak_titles_for_day["$ak_post_title->dom"]) ) // first one if ( empty($ak_titles_for_day["$ak_post_title->dom"]) ) // first one
@ -817,7 +817,7 @@ function rich_edit_exists() {
function user_can_richedit() { function user_can_richedit() {
global $wp_rich_edit, $pagenow; global $wp_rich_edit, $pagenow;
if ( !isset( $wp_rich_edit) ) { if ( !isset( $wp_rich_edit) ) {
if ( get_user_option( 'rich_editing' ) == 'true' && if ( get_user_option( 'rich_editing' ) == 'true' &&
( ( preg_match( '!AppleWebKit/(\d+)!', $_SERVER['HTTP_USER_AGENT'], $match ) && intval($match[1]) >= 420 ) || ( ( preg_match( '!AppleWebKit/(\d+)!', $_SERVER['HTTP_USER_AGENT'], $match ) && intval($match[1]) >= 420 ) ||

View File

@ -49,7 +49,7 @@ class TinyGoogleSpell {
function _xmlChars($string) { function _xmlChars($string) {
$trans = get_html_translation_table(HTML_ENTITIES, ENT_QUOTES); $trans = get_html_translation_table(HTML_ENTITIES, ENT_QUOTES);
foreach ($trans as $k => $v) foreach ($trans as $k => $v)
$trans[$k] = "&#".ord($k).";"; $trans[$k] = "&#".ord($k).";";

View File

@ -49,7 +49,7 @@ class TinyPspellShell {
$data = shell_exec($this->cmd); $data = shell_exec($this->cmd);
@unlink($this->tmpfile); @unlink($this->tmpfile);
$returnData = array(); $returnData = array();
$dataArr = preg_split("/\n/", $data, -1, PREG_SPLIT_NO_EMPTY); $dataArr = preg_split("/\n/", $data, -1, PREG_SPLIT_NO_EMPTY);

View File

@ -115,7 +115,7 @@
$words = preg_split("/ |\n/", $check, -1, PREG_SPLIT_NO_EMPTY); $words = preg_split("/ |\n/", $check, -1, PREG_SPLIT_NO_EMPTY);
$result = $tinyspell->checkWords($words); $result = $tinyspell->checkWords($words);
break; break;
case "suggest": case "suggest":
$result = $tinyspell->getSuggestion($check); $result = $tinyspell->getSuggestion($check);
break; break;
@ -138,7 +138,7 @@
header('Content-type: text/xml; charset=utf-8'); header('Content-type: text/xml; charset=utf-8');
$body = '<?xml version="1.0" encoding="utf-8" ?>'; $body = '<?xml version="1.0" encoding="utf-8" ?>';
$body .= "\n"; $body .= "\n";
if (count($result) == 0) if (count($result) == 0)
$body .= '<res id="' . $id . '" cmd="'. $cmd .'" />'; $body .= '<res id="' . $id . '" cmd="'. $cmd .'" />';
else else

View File

@ -48,7 +48,7 @@
$mce_css = str_replace('http://', 'https://', $mce_css); $mce_css = str_replace('http://', 'https://', $mce_css);
$mce_popups_css = str_replace('http://', 'https://', $mce_popups_css); $mce_popups_css = str_replace('http://', 'https://', $mce_popups_css);
} }
$mce_locale = ( '' == get_locale() ) ? 'en' : strtolower(get_locale()); $mce_locale = ( '' == get_locale() ) ? 'en' : strtolower(get_locale());
?> ?>

View File

@ -110,7 +110,7 @@ if ($index > -1) {
// Patch loading functions // Patch loading functions
//$content .= "tinyMCE_GZ.start();"; //$content .= "tinyMCE_GZ.start();";
// Do init based on index // Do init based on index
$content .= "tinyMCE.init(tinyMCECompressed.configs[" . $index . "]);"; $content .= "tinyMCE.init(tinyMCECompressed.configs[" . $index . "]);";

View File

@ -182,7 +182,7 @@ if (!CUSTOM_TAGS) {
'ol' => array(), 'ol' => array(),
'var' => array() 'var' => array()
); );
$allowedtags = array( $allowedtags = array(
'a' => array( 'a' => array(
'href' => array(), 'title' => array() 'href' => array(), 'title' => array()

View File

@ -273,21 +273,21 @@ function get_post_comments_feed_link($post_id = '', $feed = 'rss2') {
function get_edit_post_link( $id = 0 ) { function get_edit_post_link( $id = 0 ) {
$post = &get_post( $id ); $post = &get_post( $id );
if ( $post->post_type == 'attachment' ) { if ( $post->post_type == 'attachment' ) {
return; return;
} elseif ( $post->post_type == 'page' ) { } elseif ( $post->post_type == 'page' ) {
if ( !current_user_can( 'edit_page', $post->ID ) ) if ( !current_user_can( 'edit_page', $post->ID ) )
return; return;
$file = 'page'; $file = 'page';
} else { } else {
if ( !current_user_can( 'edit_post', $post->ID ) ) if ( !current_user_can( 'edit_post', $post->ID ) )
return; return;
$file = 'post'; $file = 'post';
} }
return apply_filters( 'get_edit_post_link', get_bloginfo( 'wpurl' ) . '/wp-admin/' . $file . '.php?action=edit&amp;post=' . $post->ID, $post->ID ); return apply_filters( 'get_edit_post_link', get_bloginfo( 'wpurl' ) . '/wp-admin/' . $file . '.php?action=edit&amp;post=' . $post->ID, $post->ID );
} }
@ -299,12 +299,12 @@ function edit_post_link( $link = 'Edit This', $before = '', $after = '' ) {
} elseif ( $post->post_type == 'page' ) { } elseif ( $post->post_type == 'page' ) {
if ( !current_user_can( 'edit_page', $post->ID ) ) if ( !current_user_can( 'edit_page', $post->ID ) )
return; return;
$file = 'page'; $file = 'page';
} else { } else {
if ( !current_user_can( 'edit_post', $post->ID ) ) if ( !current_user_can( 'edit_post', $post->ID ) )
return; return;
$file = 'post'; $file = 'post';
} }
@ -315,7 +315,7 @@ function edit_post_link( $link = 'Edit This', $before = '', $after = '' ) {
function get_edit_comment_link( $comment_id = 0 ) { function get_edit_comment_link( $comment_id = 0 ) {
$comment = &get_comment( $comment_id ); $comment = &get_comment( $comment_id );
$post = &get_post( $comment->comment_post_ID ); $post = &get_post( $comment->comment_post_ID );
if ( $post->post_type == 'attachment' ) { if ( $post->post_type == 'attachment' ) {
return; return;
} elseif ( $post->post_type == 'page' ) { } elseif ( $post->post_type == 'page' ) {
@ -453,18 +453,18 @@ function next_post_link($format='%link &raquo;', $link='%title', $in_same_cat =
function get_pagenum_link($pagenum = 1) { function get_pagenum_link($pagenum = 1) {
global $wp_rewrite; global $wp_rewrite;
$pagenum = (int) $pagenum; $pagenum = (int) $pagenum;
$request = remove_query_arg( 'paged' ); $request = remove_query_arg( 'paged' );
$home_root = parse_url(get_option('home')); $home_root = parse_url(get_option('home'));
$home_root = $home_root['path']; $home_root = $home_root['path'];
$home_root = preg_quote( trailingslashit( $home_root ), '|' ); $home_root = preg_quote( trailingslashit( $home_root ), '|' );
$request = preg_replace('|^'. $home_root . '|', '', $request); $request = preg_replace('|^'. $home_root . '|', '', $request);
$request = preg_replace('|^/+|', '', $request); $request = preg_replace('|^/+|', '', $request);
if ( !$wp_rewrite->using_permalinks() || is_admin() ) { if ( !$wp_rewrite->using_permalinks() || is_admin() ) {
$base = trailingslashit( get_bloginfo( 'home' ) ); $base = trailingslashit( get_bloginfo( 'home' ) );
@ -476,29 +476,29 @@ function get_pagenum_link($pagenum = 1) {
} else { } else {
$qs_regex = '|\?.*?$|'; $qs_regex = '|\?.*?$|';
preg_match( $qs_regex, $request, $qs_match ); preg_match( $qs_regex, $request, $qs_match );
if ( $qs_match[0] ) { if ( $qs_match[0] ) {
$query_string = $qs_match[0]; $query_string = $qs_match[0];
$request = preg_replace( $qs_regex, '', $request ); $request = preg_replace( $qs_regex, '', $request );
} else { } else {
$query_string = ''; $query_string = '';
} }
$request = preg_replace( '|page/(.+)/?$|', '', $request); $request = preg_replace( '|page/(.+)/?$|', '', $request);
$base = trailingslashit( get_bloginfo( 'url' ) ); $base = trailingslashit( get_bloginfo( 'url' ) );
if ( $wp_rewrite->using_index_permalinks() && $pagenum > 1 ) { if ( $wp_rewrite->using_index_permalinks() && $pagenum > 1 ) {
$base .= 'index.php/'; $base .= 'index.php/';
} }
if ( $pagenum > 1 ) { if ( $pagenum > 1 ) {
$request = ( ( !empty( $request ) ) ? trailingslashit( $request ) : $request ) . user_trailingslashit( 'page/' . $pagenum, 'paged' ); $request = ( ( !empty( $request ) ) ? trailingslashit( $request ) : $request ) . user_trailingslashit( 'page/' . $pagenum, 'paged' );
} }
$result = $base . $request . $query_string; $result = $base . $request . $query_string;
} }
return $result; return $result;
} }

View File

@ -92,13 +92,13 @@ class WP_Locale {
$trans = __('number_format_decimals'); $trans = __('number_format_decimals');
$this->number_format['decimals'] = ('number_format_decimals' == $trans) ? 0 : $trans; $this->number_format['decimals'] = ('number_format_decimals' == $trans) ? 0 : $trans;
$trans = __('number_format_decimal_point'); $trans = __('number_format_decimal_point');
$this->number_format['decimal_point'] = ('number_format_decimal_point' == $trans) ? '.' : $trans; $this->number_format['decimal_point'] = ('number_format_decimal_point' == $trans) ? '.' : $trans;
$trans = __('number_format_thousands_sep'); $trans = __('number_format_thousands_sep');
$this->number_format['thousands_sep'] = ('number_format_thousands_sep' == $trans) ? ',' : $trans; $this->number_format['thousands_sep'] = ('number_format_thousands_sep' == $trans) ? ',' : $trans;
// Import global locale vars set during inclusion of $locale.php. // Import global locale vars set during inclusion of $locale.php.
foreach ( $this->locale_vars as $var ) { foreach ( $this->locale_vars as $var ) {
if ( isset($GLOBALS[$var]) ) if ( isset($GLOBALS[$var]) )

View File

@ -159,17 +159,17 @@ endif;
if ( !function_exists( 'wp_mail' ) ) : if ( !function_exists( 'wp_mail' ) ) :
function wp_mail( $to, $subject, $message, $headers = '' ) { function wp_mail( $to, $subject, $message, $headers = '' ) {
global $phpmailer; global $phpmailer;
// (Re)create it, if it's gone missing // (Re)create it, if it's gone missing
if ( !is_object( $phpmailer ) || !is_a( $phpmailer, 'PHPMailer' ) ) { if ( !is_object( $phpmailer ) || !is_a( $phpmailer, 'PHPMailer' ) ) {
require_once ABSPATH . WPINC . '/class-phpmailer.php'; require_once ABSPATH . WPINC . '/class-phpmailer.php';
require_once ABSPATH . WPINC . '/class-smtp.php'; require_once ABSPATH . WPINC . '/class-smtp.php';
$phpmailer = new PHPMailer(); $phpmailer = new PHPMailer();
} }
// Compact the input, apply the filters, and extract them back out // Compact the input, apply the filters, and extract them back out
extract( apply_filters( 'wp_mail', compact( 'to', 'subject', 'message', 'headers' ) ) ); extract( apply_filters( 'wp_mail', compact( 'to', 'subject', 'message', 'headers' ) ) );
// Default headers // Default headers
if ( empty( $headers ) ) { if ( empty( $headers ) ) {
$headers = array( $headers = array(
@ -180,18 +180,18 @@ function wp_mail( $to, $subject, $message, $headers = '' ) {
// string headers and an array of headers. // string headers and an array of headers.
$tempheaders = (array) explode( "\n", $headers ); $tempheaders = (array) explode( "\n", $headers );
$headers = array(); $headers = array();
// If it's actually got contents // If it's actually got contents
if ( !empty( $tempheaders ) ) { if ( !empty( $tempheaders ) ) {
// Iterate through the raw headers // Iterate through the raw headers
foreach ( $tempheaders as $header ) { foreach ( $tempheaders as $header ) {
// Explode them out // Explode them out
list( $name, $content ) = explode( ':', trim( $header ), 2 ); list( $name, $content ) = explode( ':', trim( $header ), 2 );
// Cleanup crew // Cleanup crew
$name = trim( $name ); $name = trim( $name );
$content = trim( $content ); $content = trim( $content );
// Mainly for legacy -- process a From: header if it's there // Mainly for legacy -- process a From: header if it's there
if ( $name == 'From' ) { if ( $name == 'From' ) {
if ( strpos( '<', $content ) !== false ) { if ( strpos( '<', $content ) !== false ) {
@ -199,7 +199,7 @@ function wp_mail( $to, $subject, $message, $headers = '' ) {
$from_name = substr( $content, 0, strpos( '<', $content ) - 1 ); $from_name = substr( $content, 0, strpos( '<', $content ) - 1 );
$from_name = str_replace( '"', '', $from_name ); $from_name = str_replace( '"', '', $from_name );
$from_name = trim( $from_name ); $from_name = trim( $from_name );
$from_email = substr( $content, strpos( '<', $content ) + 1 ); $from_email = substr( $content, strpos( '<', $content ) + 1 );
$from_email = str_replace( '>', '', $from_email ); $from_email = str_replace( '>', '', $from_email );
$from_email = trim( $from_email ); $from_email = trim( $from_email );
@ -221,7 +221,7 @@ function wp_mail( $to, $subject, $message, $headers = '' ) {
} }
} }
} }
// Empty out the values that may be set // Empty out the values that may be set
$phpmailer->ClearAddresses(); $phpmailer->ClearAddresses();
$phpmailer->ClearAllRecipients(); $phpmailer->ClearAllRecipients();
@ -230,13 +230,13 @@ function wp_mail( $to, $subject, $message, $headers = '' ) {
$phpmailer->ClearCCs(); $phpmailer->ClearCCs();
$phpmailer->ClearCustomHeaders(); $phpmailer->ClearCustomHeaders();
$phpmailer->ClearReplyTos(); $phpmailer->ClearReplyTos();
// From email and name // From email and name
// If we don't have a name from the input headers // If we don't have a name from the input headers
if ( !isset( $from_name ) ) { if ( !isset( $from_name ) ) {
$from_name = 'WordPress'; $from_name = 'WordPress';
} }
// If we don't have an email from the input headers // If we don't have an email from the input headers
if ( !isset( $from_email ) ) { if ( !isset( $from_email ) ) {
// Get the site domain and get rid of www. // Get the site domain and get rid of www.
@ -244,58 +244,58 @@ function wp_mail( $to, $subject, $message, $headers = '' ) {
if ( substr( $sitename, 0, 4 ) == 'www.' ) { if ( substr( $sitename, 0, 4 ) == 'www.' ) {
$sitename = substr( $sitename, 4 ); $sitename = substr( $sitename, 4 );
} }
$from_email = 'wordpress@' . $sitename; $from_email = 'wordpress@' . $sitename;
} }
// Set the from name and email // Set the from name and email
$phpmailer->From = apply_filters( 'wp_mail_from', $from_email ); $phpmailer->From = apply_filters( 'wp_mail_from', $from_email );
$phpmailer->FromName = apply_filters( 'wp_mail_from_name', $from_name ); $phpmailer->FromName = apply_filters( 'wp_mail_from_name', $from_name );
// Set destination address // Set destination address
$phpmailer->AddAddress( $to ); $phpmailer->AddAddress( $to );
// Set mail's subject and body // Set mail's subject and body
$phpmailer->Subject = $subject; $phpmailer->Subject = $subject;
$phpmailer->Body = $message; $phpmailer->Body = $message;
// Set to use PHP's mail() // Set to use PHP's mail()
$phpmailer->IsMail(); $phpmailer->IsMail();
// Set Content-Type and charset // Set Content-Type and charset
// If we don't have a content-type from the input headers // If we don't have a content-type from the input headers
if ( !isset( $content_type ) ) { if ( !isset( $content_type ) ) {
$content_type = 'text/plain'; $content_type = 'text/plain';
} }
// Set whether it's plaintext or not, depending on $content_type // Set whether it's plaintext or not, depending on $content_type
if ( $content_type == 'text/html' ) { if ( $content_type == 'text/html' ) {
$phpmailer->IsHTML( true ); $phpmailer->IsHTML( true );
} else { } else {
$phpmailer->IsHTML( false ); $phpmailer->IsHTML( false );
} }
// If we don't have a charset from the input headers // If we don't have a charset from the input headers
if ( !isset( $charset ) ) { if ( !isset( $charset ) ) {
$charset = get_bloginfo( 'charset' ); $charset = get_bloginfo( 'charset' );
} }
// Set the content-type and charset // Set the content-type and charset
$phpmailer->ContentType = apply_filters( 'wp_mail_content_type', 'text/plain' ); $phpmailer->ContentType = apply_filters( 'wp_mail_content_type', 'text/plain' );
$phpmailer->CharSet = apply_filters( 'wp_mail_charset', $charset ); $phpmailer->CharSet = apply_filters( 'wp_mail_charset', $charset );
// Set custom headers // Set custom headers
if ( !empty( $headers ) ) { if ( !empty( $headers ) ) {
foreach ( $headers as $name => $content ) { foreach ( $headers as $name => $content ) {
$phpmailer->AddCustomHeader( sprintf( '%1$s: %2$s', $name, $content ) ); $phpmailer->AddCustomHeader( sprintf( '%1$s: %2$s', $name, $content ) );
} }
} }
do_action_ref_array( 'phpmailer_init', array( &$phpmailer ) ); do_action_ref_array( 'phpmailer_init', array( &$phpmailer ) );
// Send! // Send!
$result = @$phpmailer->Send(); $result = @$phpmailer->Send();
return $result; return $result;
} }
endif; endif;
@ -533,7 +533,7 @@ function wp_notify_postauthor($comment_id, $comment_type='') {
$message_headers = apply_filters('comment_notification_headers', $message_headers, $comment_id); $message_headers = apply_filters('comment_notification_headers', $message_headers, $comment_id);
@wp_mail($user->user_email, $subject, $notify_message, $message_headers); @wp_mail($user->user_email, $subject, $notify_message, $message_headers);
return true; return true;
} }
endif; endif;
@ -549,7 +549,7 @@ function wp_notify_moderator($comment_id) {
if( get_option( "moderation_notify" ) == 0 ) if( get_option( "moderation_notify" ) == 0 )
return true; return true;
$comment = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID='$comment_id' LIMIT 1"); $comment = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID='$comment_id' LIMIT 1");
$post = $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE ID='$comment->comment_post_ID' LIMIT 1"); $post = $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE ID='$comment->comment_post_ID' LIMIT 1");

View File

@ -141,7 +141,7 @@ function wp_link_pages($args = '') {
'previouspagelink' => __('Previous page'), 'pagelink' => '%', 'previouspagelink' => __('Previous page'), 'pagelink' => '%',
'more_file' => '', 'echo' => 1 'more_file' => '', 'echo' => 1
); );
$r = wp_parse_args( $args, $defaults ); $r = wp_parse_args( $args, $defaults );
extract( $r ); extract( $r );
@ -254,7 +254,7 @@ function wp_dropdown_pages($args = '') {
'selected' => 0, 'echo' => 1, 'selected' => 0, 'echo' => 1,
'name' => 'page_id', 'show_option_none' => '' 'name' => 'page_id', 'show_option_none' => ''
); );
$r = wp_parse_args( $args, $defaults ); $r = wp_parse_args( $args, $defaults );
extract( $r ); extract( $r );
@ -285,7 +285,7 @@ function wp_list_pages($args = '') {
'title_li' => __('Pages'), 'echo' => 1, 'title_li' => __('Pages'), 'echo' => 1,
'authors' => '', 'sort_column' => 'menu_order, post_title' 'authors' => '', 'sort_column' => 'menu_order, post_title'
); );
$r = wp_parse_args( $args, $defaults ); $r = wp_parse_args( $args, $defaults );
extract( $r ); extract( $r );

View File

@ -27,7 +27,7 @@ function update_attached_file( $attachment_id, $file ) {
function &get_children($args = '', $output = OBJECT) { function &get_children($args = '', $output = OBJECT) {
global $post_cache, $wpdb, $blog_id; global $post_cache, $wpdb, $blog_id;
if ( empty( $args ) ) { if ( empty( $args ) ) {
if ( isset( $GLOBALS['post'] ) ) { if ( isset( $GLOBALS['post'] ) ) {
$args = 'post_parent=' . (int) $GLOBALS['post']->post_parent; $args = 'post_parent=' . (int) $GLOBALS['post']->post_parent;
@ -39,12 +39,12 @@ function &get_children($args = '', $output = OBJECT) {
} elseif ( is_numeric( $args ) ) { } elseif ( is_numeric( $args ) ) {
$args = 'post_parent=' . (int) $args; $args = 'post_parent=' . (int) $args;
} }
$defaults = array( $defaults = array(
'numberposts' => -1, 'post_type' => '', 'numberposts' => -1, 'post_type' => '',
'post_status' => '', 'post_parent' => 0 'post_status' => '', 'post_parent' => 0
); );
$r = wp_parse_args( $args, $defaults ); $r = wp_parse_args( $args, $defaults );
$children = get_posts( $r ); $children = get_posts( $r );
@ -174,7 +174,7 @@ function get_post_type($post = false) {
function get_posts($args) { function get_posts($args) {
global $wpdb; global $wpdb;
$defaults = array( $defaults = array(
'numberposts' => 5, 'offset' => 0, 'numberposts' => 5, 'offset' => 0,
'category' => 0, 'orderby' => 'post_date', 'category' => 0, 'orderby' => 'post_date',
@ -183,10 +183,10 @@ function get_posts($args) {
'meta_value' =>'', 'post_type' => 'post', 'meta_value' =>'', 'post_type' => 'post',
'post_status' => 'publish', 'post_parent' => 0 'post_status' => 'publish', 'post_parent' => 0
); );
$r = wp_parse_args( $args, $defaults ); $r = wp_parse_args( $args, $defaults );
extract( $r ); extract( $r );
$numberposts = (int) $numberposts; $numberposts = (int) $numberposts;
$offset = (int) $offset; $offset = (int) $offset;
$category = (int) $category; $category = (int) $category;
@ -430,7 +430,7 @@ function wp_delete_post($postid = 0) {
} }
do_action('deleted_post', $postid); do_action('deleted_post', $postid);
return $post; return $post;
} }
@ -449,7 +449,7 @@ function wp_get_post_tags( $post_id = 0, $args = array() ) {
$defaults = array('fields' => 'all'); $defaults = array('fields' => 'all');
$args = wp_parse_args( $args, $defaults ); $args = wp_parse_args( $args, $defaults );
$tags = get_object_terms($post_id, 'post_tag', $args); $tags = get_object_terms($post_id, 'post_tag', $args);
return $tags; return $tags;
@ -777,9 +777,9 @@ function wp_add_post_tags($post_id = 0, $tags = '') {
function wp_set_post_tags( $post_id = 0, $tags = '', $append = false ) { function wp_set_post_tags( $post_id = 0, $tags = '', $append = false ) {
/* $append - true = don't delete existing tags, just add on, false = replace the tags with the new tags */ /* $append - true = don't delete existing tags, just add on, false = replace the tags with the new tags */
global $wpdb; global $wpdb;
$post_id = (int) $post_id; $post_id = (int) $post_id;
if ( !$post_id ) if ( !$post_id )
return false; return false;
@ -1040,7 +1040,7 @@ function get_page_uri($page_id) {
function &get_pages($args = '') { function &get_pages($args = '') {
global $wpdb; global $wpdb;
$defaults = array( $defaults = array(
'child_of' => 0, 'sort_order' => 'ASC', 'child_of' => 0, 'sort_order' => 'ASC',
'sort_column' => 'post_title', 'hierarchical' => 1, 'sort_column' => 'post_title', 'hierarchical' => 1,
@ -1048,7 +1048,7 @@ function &get_pages($args = '') {
'meta_key' => '', 'meta_value' => '', 'meta_key' => '', 'meta_value' => '',
'authors' => '' 'authors' => ''
); );
$r = wp_parse_args( $args, $defaults ); $r = wp_parse_args( $args, $defaults );
extract( $r ); extract( $r );

View File

@ -461,7 +461,7 @@ class WP_Query {
$qv['attachment_id'] = $qv['subpost_id']; $qv['attachment_id'] = $qv['subpost_id'];
$qv['attachment_id'] = (int) $qv['attachment_id']; $qv['attachment_id'] = (int) $qv['attachment_id'];
if ( ('' != $qv['attachment']) || !empty($qv['attachment_id']) ) { if ( ('' != $qv['attachment']) || !empty($qv['attachment_id']) ) {
$this->is_single = true; $this->is_single = true;
$this->is_attachment = true; $this->is_attachment = true;
@ -1021,7 +1021,7 @@ class WP_Query {
if ( is_admin() ) if ( is_admin() )
$where .= " OR post_status = 'future' OR post_status = 'draft'"; $where .= " OR post_status = 'future' OR post_status = 'draft'";
if ( is_user_logged_in() ) { if ( is_user_logged_in() ) {
$where .= current_user_can( "read_private_{$post_type}s" ) ? " OR post_status = 'private'" : " OR post_author = $user_ID AND post_status = 'private'"; $where .= current_user_can( "read_private_{$post_type}s" ) ? " OR post_status = 'private'" : " OR post_author = $user_ID AND post_status = 'private'";
} }

View File

@ -63,7 +63,7 @@ function add_rewrite_endpoint($name, $places) {
// determine the post ID it represents. // determine the post ID it represents.
function url_to_postid($url) { function url_to_postid($url) {
global $wp_rewrite; global $wp_rewrite;
$url = apply_filters('url_to_postid', $url); $url = apply_filters('url_to_postid', $url);
// First, check to see if there is a 'p=N' or 'page_id=N' to match against // First, check to see if there is a 'p=N' or 'page_id=N' to match against

View File

@ -11,11 +11,11 @@ class WP_Scripts {
function default_scripts() { function default_scripts() {
$this->add( 'dbx', '/wp-includes/js/dbx.js', false, '2.05' ); $this->add( 'dbx', '/wp-includes/js/dbx.js', false, '2.05' );
$this->add( 'fat', '/wp-includes/js/fat.js', false, '1.0-RC1_3660' ); $this->add( 'fat', '/wp-includes/js/fat.js', false, '1.0-RC1_3660' );
$this->add( 'sack', '/wp-includes/js/tw-sack.js', false, '1.6.1' ); $this->add( 'sack', '/wp-includes/js/tw-sack.js', false, '1.6.1' );
$this->add( 'quicktags', '/wp-includes/js/quicktags.js', false, '3958' ); $this->add( 'quicktags', '/wp-includes/js/quicktags.js', false, '3958' );
$this->localize( 'quicktags', 'quicktagsL10n', array( $this->localize( 'quicktags', 'quicktagsL10n', array(
'quickLinks' => __('(Quick Links)'), 'quickLinks' => __('(Quick Links)'),
@ -28,15 +28,15 @@ class WP_Scripts {
'enterImageURL' => __('Enter the URL of the image'), 'enterImageURL' => __('Enter the URL of the image'),
'enterImageDescription' => __('Enter a description of the image') 'enterImageDescription' => __('Enter a description of the image')
) ); ) );
$this->add( 'colorpicker', '/wp-includes/js/colorpicker.js', false, '3517' ); $this->add( 'colorpicker', '/wp-includes/js/colorpicker.js', false, '3517' );
$this->add( 'tiny_mce', '/wp-includes/js/tinymce/tiny_mce_gzip.php', false, '20070528' ); $this->add( 'tiny_mce', '/wp-includes/js/tinymce/tiny_mce_gzip.php', false, '20070528' );
$mce_config = apply_filters('tiny_mce_config_url', '/wp-includes/js/tinymce/tiny_mce_config.php'); $mce_config = apply_filters('tiny_mce_config_url', '/wp-includes/js/tinymce/tiny_mce_config.php');
$this->add( 'wp_tiny_mce', $mce_config, array('tiny_mce'), '20070528' ); $this->add( 'wp_tiny_mce', $mce_config, array('tiny_mce'), '20070528' );
$this->add( 'prototype', '/wp-includes/js/prototype.js', false, '1.5.1'); $this->add( 'prototype', '/wp-includes/js/prototype.js', false, '1.5.1');
$this->add( 'autosave', '/wp-includes/js/autosave.js', array('prototype', 'sack'), '20070306'); $this->add( 'autosave', '/wp-includes/js/autosave.js', array('prototype', 'sack'), '20070306');
$this->localize( 'autosave', 'autosaveL10n', array( $this->localize( 'autosave', 'autosaveL10n', array(
'autosaveInterval' => apply_filters('autosave_interval', '120'), 'autosaveInterval' => apply_filters('autosave_interval', '120'),
@ -45,7 +45,7 @@ class WP_Scripts {
'requestFile' => get_option( 'siteurl' ) . '/wp-admin/admin-ajax.php', 'requestFile' => get_option( 'siteurl' ) . '/wp-admin/admin-ajax.php',
'savingText' => __('Saving Draft...') 'savingText' => __('Saving Draft...')
) ); ) );
$this->add( 'wp-ajax', '/wp-includes/js/wp-ajax.js', array('prototype'), '20070306'); $this->add( 'wp-ajax', '/wp-includes/js/wp-ajax.js', array('prototype'), '20070306');
$this->localize( 'wp-ajax', 'WPAjaxL10n', array( $this->localize( 'wp-ajax', 'WPAjaxL10n', array(
'defaultUrl' => get_option( 'siteurl' ) . '/wp-admin/admin-ajax.php', 'defaultUrl' => get_option( 'siteurl' ) . '/wp-admin/admin-ajax.php',
@ -53,13 +53,13 @@ class WP_Scripts {
'strangeText' => __("Something strange happened. Try refreshing the page."), 'strangeText' => __("Something strange happened. Try refreshing the page."),
'whoaText' => __("Slow down, I'm still sending your data!") 'whoaText' => __("Slow down, I'm still sending your data!")
) ); ) );
$this->add( 'listman', '/wp-includes/js/list-manipulation.js', array('wp-ajax', 'fat'), '20070306' ); $this->add( 'listman', '/wp-includes/js/list-manipulation.js', array('wp-ajax', 'fat'), '20070306' );
$this->localize( 'listman', 'listManL10n', array( $this->localize( 'listman', 'listManL10n', array(
'jumpText' => __('Jump to new item'), 'jumpText' => __('Jump to new item'),
'delText' => __('Are you sure you want to delete this %thing%?') 'delText' => __('Are you sure you want to delete this %thing%?')
) ); ) );
$this->add( 'scriptaculous-root', '/wp-includes/js/scriptaculous/wp-scriptaculous.js', array('prototype'), '1.7.1-b2'); $this->add( 'scriptaculous-root', '/wp-includes/js/scriptaculous/wp-scriptaculous.js', array('prototype'), '1.7.1-b2');
$this->add( 'scriptaculous-builder', '/wp-includes/js/scriptaculous/builder.js', array('scriptaculous-root'), '1.7.1-b2'); $this->add( 'scriptaculous-builder', '/wp-includes/js/scriptaculous/builder.js', array('scriptaculous-root'), '1.7.1-b2');
$this->add( 'scriptaculous-dragdrop', '/wp-includes/js/scriptaculous/dragdrop.js', array('scriptaculous-builder', 'scriptaculous-effects'), '1.7.1-b2'); $this->add( 'scriptaculous-dragdrop', '/wp-includes/js/scriptaculous/dragdrop.js', array('scriptaculous-builder', 'scriptaculous-effects'), '1.7.1-b2');
@ -68,13 +68,13 @@ class WP_Scripts {
$this->add( 'scriptaculous-sound', '/wp-includes/js/scriptaculous/sound.js', array( 'scriptaculous-root' ), '1.7.1-b2' ); $this->add( 'scriptaculous-sound', '/wp-includes/js/scriptaculous/sound.js', array( 'scriptaculous-root' ), '1.7.1-b2' );
$this->add( 'scriptaculous-controls', '/wp-includes/js/scriptaculous/controls.js', array('scriptaculous-root'), '1.7.1-b2'); $this->add( 'scriptaculous-controls', '/wp-includes/js/scriptaculous/controls.js', array('scriptaculous-root'), '1.7.1-b2');
$this->add( 'scriptaculous', '', array('scriptaculous-dragdrop', 'scriptaculous-slider', 'scriptaculous-controls'), '1.7.1-b2'); $this->add( 'scriptaculous', '', array('scriptaculous-dragdrop', 'scriptaculous-slider', 'scriptaculous-controls'), '1.7.1-b2');
$this->add( 'cropper', '/wp-includes/js/crop/cropper.js', array('scriptaculous-dragdrop'), '20070118'); $this->add( 'cropper', '/wp-includes/js/crop/cropper.js', array('scriptaculous-dragdrop'), '20070118');
$this->add( 'jquery', '/wp-includes/js/jquery/jquery.js', false, '1.1.2'); $this->add( 'jquery', '/wp-includes/js/jquery/jquery.js', false, '1.1.2');
$this->add( 'jquery-form', '/wp-includes/js/jquery/jquery.form.js', array('jquery'), '1.0.3'); $this->add( 'jquery-form', '/wp-includes/js/jquery/jquery.form.js', array('jquery'), '1.0.3');
$this->add( 'interface', '/wp-includes/js/jquery/interface.js', array('jquery'), '1.2'); $this->add( 'interface', '/wp-includes/js/jquery/interface.js', array('jquery'), '1.2');
if ( is_admin() ) { if ( is_admin() ) {
global $pagenow; global $pagenow;
$man = false; $man = false;
@ -182,11 +182,11 @@ class WP_Scripts {
$ver .= '&amp;' . $this->args[$handle]; $ver .= '&amp;' . $this->args[$handle];
$src = 0 === strpos($this->scripts[$handle]->src, 'http://') ? $this->scripts[$handle]->src : get_option( 'siteurl' ) . $this->scripts[$handle]->src; $src = 0 === strpos($this->scripts[$handle]->src, 'http://') ? $this->scripts[$handle]->src : get_option( 'siteurl' ) . $this->scripts[$handle]->src;
$src = $this->scripts[$handle]->src; $src = $this->scripts[$handle]->src;
if (!preg_match('|^https?://|', $src)) { if (!preg_match('|^https?://|', $src)) {
$src = get_option('siteurl') . $src; $src = get_option('siteurl') . $src;
} }
$src = add_query_arg('ver', $ver, $src); $src = add_query_arg('ver', $ver, $src);
$src = clean_url(apply_filters( 'script_loader_src', $src )); $src = clean_url(apply_filters( 'script_loader_src', $src ));
echo "<script type='text/javascript' src='$src'></script>\n"; echo "<script type='text/javascript' src='$src'></script>\n";

View File

@ -28,17 +28,17 @@ class StreamReader {
function read($bytes) { function read($bytes) {
return false; return false;
} }
// should return new position // should return new position
function seekto($position) { function seekto($position) {
return false; return false;
} }
// returns current position // returns current position
function currentpos() { function currentpos() {
return false; return false;
} }
// returns length of entire stream (limit for seekto()s) // returns length of entire stream (limit for seekto()s)
function length() { function length() {
return false; return false;
@ -114,7 +114,7 @@ class FileReader {
$bytes -= strlen($chunk); $bytes -= strlen($chunk);
} }
$this->_pos = ftell($this->_fd); $this->_pos = ftell($this->_fd);
return $data; return $data;
} else return ''; } else return '';
} }

View File

@ -98,7 +98,7 @@ function wp_insert_term( $term, $taxonomy, $args = array() ) {
$slug = sanitize_title($slug, $term_id); $slug = sanitize_title($slug, $term_id);
$wpdb->query("UPDATE $wpdb->terms SET slug = '$slug' WHERE term_id = '$term_id'"); $wpdb->query("UPDATE $wpdb->terms SET slug = '$slug' WHERE term_id = '$term_id'");
} }
$tt_id = $wpdb->get_var("SELECT tt.term_taxonomy_id FROM $wpdb->term_taxonomy AS tt INNER JOIN $wpdb->terms AS t ON tt.term_id = t.term_id WHERE tt.taxonomy = '$taxonomy' AND t.term_id = $term_id"); $tt_id = $wpdb->get_var("SELECT tt.term_taxonomy_id FROM $wpdb->term_taxonomy AS tt INNER JOIN $wpdb->terms AS t ON tt.term_id = t.term_id WHERE tt.taxonomy = '$taxonomy' AND t.term_id = $term_id");
if ( !empty($tt_id) ) if ( !empty($tt_id) )
@ -135,7 +135,7 @@ function wp_delete_object_term_relationships( $object_id, $taxonomies ) {
wp_update_term_count($terms, $taxonomy); wp_update_term_count($terms, $taxonomy);
} }
// TODO clear the cache // TODO clear the cache
} }
@ -239,7 +239,7 @@ function wp_update_term( $term, $taxonomy, $args = array() ) {
$slug = sanitize_title($name, $term_id); $slug = sanitize_title($name, $term_id);
$wpdb->query("UPDATE $wpdb->terms SET slug = '$slug' WHERE term_id = '$term_id'"); $wpdb->query("UPDATE $wpdb->terms SET slug = '$slug' WHERE term_id = '$term_id'");
} }
$tt_id = $wpdb->get_var("SELECT tt.term_taxonomy_id FROM $wpdb->term_taxonomy AS tt INNER JOIN $wpdb->terms AS t ON tt.term_id = t.term_id WHERE tt.taxonomy = '$taxonomy' AND t.term_id = $term_id"); $tt_id = $wpdb->get_var("SELECT tt.term_taxonomy_id FROM $wpdb->term_taxonomy AS tt INNER JOIN $wpdb->terms AS t ON tt.term_id = t.term_id WHERE tt.taxonomy = '$taxonomy' AND t.term_id = $term_id");
$wpdb->query("UPDATE $wpdb->term_taxonomy SET term_id = '$term_id', taxonomy = '$taxonomy', description = '$description', parent = '$parent' WHERE term_taxonomy_id = '$tt_id'"); $wpdb->query("UPDATE $wpdb->term_taxonomy SET term_id = '$term_id', taxonomy = '$taxonomy', description = '$description', parent = '$parent' WHERE term_taxonomy_id = '$tt_id'");
@ -300,7 +300,7 @@ function is_term($term, $taxonomy = '') {
return $wpdb->get_row("SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE $where AND tt.taxonomy = '$taxonomy'", ARRAY_A); return $wpdb->get_row("SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE $where AND tt.taxonomy = '$taxonomy'", ARRAY_A);
} }
/** /**
* Given an array of terms, returns those that are defined term slugs. Ignores integers. * Given an array of terms, returns those that are defined term slugs. Ignores integers.
* @param array $terms The term slugs to check for a definition. * @param array $terms The term slugs to check for a definition.
@ -316,7 +316,7 @@ function get_defined_terms($terms) {
$terms = "'" . implode("', '", $searches) . "'"; $terms = "'" . implode("', '", $searches) . "'";
return $wpdb->get_col("SELECT slug FROM $wpdb->terms WHERE slug IN ($terms)"); return $wpdb->get_col("SELECT slug FROM $wpdb->terms WHERE slug IN ($terms)");
} }
/** /**
* Relates an object (post, link etc) to a term and taxonomy type. Creates the term and taxonomy * Relates an object (post, link etc) to a term and taxonomy type. Creates the term and taxonomy
* relationship if it doesn't already exist. Creates a term if it doesn't exist (using the slug). * relationship if it doesn't already exist. Creates a term if it doesn't exist (using the slug).
@ -331,7 +331,7 @@ function wp_set_object_terms($object_id, $terms, $taxonomy, $append = false) {
if ( ! is_taxonomy($taxonomy) ) if ( ! is_taxonomy($taxonomy) )
return false; return false;
if ( !is_array($terms) ) if ( !is_array($terms) )
$terms = array($terms); $terms = array($terms);

View File

@ -70,7 +70,7 @@ function get_theme_data( $theme_file ) {
'em' => array(), 'em' => array(),
'strong' => array() 'strong' => array()
); );
$theme_data = implode( '', file( $theme_file ) ); $theme_data = implode( '', file( $theme_file ) );
$theme_data = str_replace ( '\r', '\n', $theme_data ); $theme_data = str_replace ( '\r', '\n', $theme_data );
preg_match( '|Theme Name:(.*)$|mi', $theme_data, $theme_name ); preg_match( '|Theme Name:(.*)$|mi', $theme_data, $theme_name );
@ -79,24 +79,24 @@ function get_theme_data( $theme_file ) {
preg_match( '|Author:(.*)$|mi', $theme_data, $author_name ); preg_match( '|Author:(.*)$|mi', $theme_data, $author_name );
preg_match( '|Author URI:(.*)$|mi', $theme_data, $author_uri ); preg_match( '|Author URI:(.*)$|mi', $theme_data, $author_uri );
preg_match( '|Template:(.*)$|mi', $theme_data, $template ); preg_match( '|Template:(.*)$|mi', $theme_data, $template );
if ( preg_match( '|Version:(.*)|i', $theme_data, $version ) ) if ( preg_match( '|Version:(.*)|i', $theme_data, $version ) )
$version = wp_kses( trim( $version[1] ), $themes_allowed_tags ); $version = wp_kses( trim( $version[1] ), $themes_allowed_tags );
else else
$version = ''; $version = '';
if ( preg_match('|Status:(.*)|i', $theme_data, $status) ) if ( preg_match('|Status:(.*)|i', $theme_data, $status) )
$status = wp_kses( trim( $status[1] ), $themes_allowed_tags ); $status = wp_kses( trim( $status[1] ), $themes_allowed_tags );
else else
$status = 'publish'; $status = 'publish';
$name = $theme = wp_kses( trim( $theme_name[1] ), $themes_allowed_tags ); $name = $theme = wp_kses( trim( $theme_name[1] ), $themes_allowed_tags );
$theme_uri = clean_url( trim( $theme_uri[1] ) ); $theme_uri = clean_url( trim( $theme_uri[1] ) );
$description = wptexturize( wp_kses( trim( $description[1] ), $themes_allowed_tags ) ); $description = wptexturize( wp_kses( trim( $description[1] ), $themes_allowed_tags ) );
$template = wp_kses( trim( $template[1] ), $themes_allowed_tags ); $template = wp_kses( trim( $template[1] ), $themes_allowed_tags );
$author_uri = clean_url( trim( $author_uri[1] ) ); $author_uri = clean_url( trim( $author_uri[1] ) );
if ( empty( $author_uri[1] ) ) { if ( empty( $author_uri[1] ) ) {
$author = wp_kses( trim( $author_name[1] ), $themes_allowed_tags ); $author = wp_kses( trim( $author_name[1] ), $themes_allowed_tags );
} else { } else {

View File

@ -188,9 +188,9 @@ function wp_dropdown_users( $args = '' ) {
'show' => 'display_name', 'echo' => 1, 'show' => 'display_name', 'echo' => 1,
'selected' => 0, 'name' => 'user', 'class' => '' 'selected' => 0, 'name' => 'user', 'class' => ''
); );
$defaults['selected'] = is_author() ? get_query_var( 'author' ) : 0; $defaults['selected'] = is_author() ? get_query_var( 'author' ) : 0;
$r = wp_parse_args( $args, $defaults ); $r = wp_parse_args( $args, $defaults );
extract( $r ); extract( $r );

View File

@ -38,7 +38,7 @@ $is_IIS = (strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS') !== false) ? tru
$wp_header_to_desc = apply_filters( 'wp_header_to_desc_array', array( $wp_header_to_desc = apply_filters( 'wp_header_to_desc_array', array(
100 => 'Continue', 100 => 'Continue',
101 => 'Switching Protocols', 101 => 'Switching Protocols',
200 => 'OK', 200 => 'OK',
201 => 'Created', 201 => 'Created',
202 => 'Accepted', 202 => 'Accepted',
@ -46,7 +46,7 @@ $wp_header_to_desc = apply_filters( 'wp_header_to_desc_array', array(
204 => 'No Content', 204 => 'No Content',
205 => 'Reset Content', 205 => 'Reset Content',
206 => 'Partial Content', 206 => 'Partial Content',
300 => 'Multiple Choices', 300 => 'Multiple Choices',
301 => 'Moved Permanently', 301 => 'Moved Permanently',
302 => 'Found', 302 => 'Found',
@ -54,7 +54,7 @@ $wp_header_to_desc = apply_filters( 'wp_header_to_desc_array', array(
304 => 'Not Modified', 304 => 'Not Modified',
305 => 'Use Proxy', 305 => 'Use Proxy',
307 => 'Temporary Redirect', 307 => 'Temporary Redirect',
400 => 'Bad Request', 400 => 'Bad Request',
401 => 'Unauthorized', 401 => 'Unauthorized',
403 => 'Forbidden', 403 => 'Forbidden',
@ -72,7 +72,7 @@ $wp_header_to_desc = apply_filters( 'wp_header_to_desc_array', array(
415 => 'Unsupported Media Type', 415 => 'Unsupported Media Type',
416 => 'Requested Range Not Satisfiable', 416 => 'Requested Range Not Satisfiable',
417 => 'Expectation Failed', 417 => 'Expectation Failed',
500 => 'Internal Server Error', 500 => 'Internal Server Error',
501 => 'Not Implemented', 501 => 'Not Implemented',
502 => 'Bad Gateway', 502 => 'Bad Gateway',

View File

@ -59,7 +59,7 @@ function register_sidebar($args = array()) {
function unregister_sidebar( $name ) { function unregister_sidebar( $name ) {
global $wp_registered_sidebars; global $wp_registered_sidebars;
if ( isset( $wp_registered_sidebars[$name] ) ) if ( isset( $wp_registered_sidebars[$name] ) )
unset( $wp_registered_sidebars[$name] ); unset( $wp_registered_sidebars[$name] );
} }
@ -329,17 +329,17 @@ function wp_get_widget_defaults() {
function wp_widget_pages( $args ) { function wp_widget_pages( $args ) {
extract( $args ); extract( $args );
$options = get_option( 'widget_pages' ); $options = get_option( 'widget_pages' );
$title = empty( $options['title'] ) ? __( 'Pages' ) : $options['title']; $title = empty( $options['title'] ) ? __( 'Pages' ) : $options['title'];
$sortby = empty( $options['sortby'] ) ? 'menu_order' : $options['sortby']; $sortby = empty( $options['sortby'] ) ? 'menu_order' : $options['sortby'];
$exclude = empty( $options['exclude'] ) ? '' : '&exclude=' . $options['exclude']; $exclude = empty( $options['exclude'] ) ? '' : '&exclude=' . $options['exclude'];
if ( $sortby == 'menu_order' ) { if ( $sortby == 'menu_order' ) {
$sortby = 'menu_order, post_title'; $sortby = 'menu_order, post_title';
} }
$out = wp_list_pages( 'title_li=&echo=0&sort_column=' . $sortby . $exclude ); $out = wp_list_pages( 'title_li=&echo=0&sort_column=' . $sortby . $exclude );
if ( !empty( $out ) ) { if ( !empty( $out ) ) {
?> ?>
<?php echo $before_widget; ?> <?php echo $before_widget; ?>
@ -356,15 +356,15 @@ function wp_widget_pages_control() {
$options = $newoptions = get_option('widget_pages'); $options = $newoptions = get_option('widget_pages');
if ( $_POST['pages-submit'] ) { if ( $_POST['pages-submit'] ) {
$newoptions['title'] = strip_tags(stripslashes($_POST['pages-title'])); $newoptions['title'] = strip_tags(stripslashes($_POST['pages-title']));
$sortby = stripslashes( $_POST['pages-sortby'] ); $sortby = stripslashes( $_POST['pages-sortby'] );
if ( in_array( $sortby, array( 'post_title', 'menu_order', 'ID' ) ) ) { if ( in_array( $sortby, array( 'post_title', 'menu_order', 'ID' ) ) ) {
$newoptions['sortby'] = $sortby; $newoptions['sortby'] = $sortby;
} else { } else {
$newoptions['sortby'] = 'menu_order'; $newoptions['sortby'] = 'menu_order';
} }
$newoptions['exclude'] = strip_tags( stripslashes( $_POST['pages-exclude'] ) ); $newoptions['exclude'] = strip_tags( stripslashes( $_POST['pages-exclude'] ) );
} }
if ( $options != $newoptions ) { if ( $options != $newoptions ) {
@ -798,7 +798,7 @@ function wp_widget_recent_comments_register() {
$class = array('classname' => 'widget_recent_comments'); $class = array('classname' => 'widget_recent_comments');
wp_register_sidebar_widget('recent-comments', __('Recent Comments'), 'wp_widget_recent_comments', $class); wp_register_sidebar_widget('recent-comments', __('Recent Comments'), 'wp_widget_recent_comments', $class);
wp_register_widget_control('recent-comments', __('Recent Comments'), 'wp_widget_recent_comments_control', $dims); wp_register_widget_control('recent-comments', __('Recent Comments'), 'wp_widget_recent_comments_control', $dims);
if ( is_active_widget('wp_widget_recent_comments') ) if ( is_active_widget('wp_widget_recent_comments') )
add_action('wp_head', 'wp_widget_recent_comments_style'); add_action('wp_head', 'wp_widget_recent_comments_style');
} }

View File

@ -258,7 +258,7 @@ class wpdb {
$this->func_call = "\$db->get_row(\"$query\",$output,$y)"; $this->func_call = "\$db->get_row(\"$query\",$output,$y)";
if ( $query ) if ( $query )
$this->query($query); $this->query($query);
if ( !isset($this->last_result[$y]) ) if ( !isset($this->last_result[$y]) )
return null; return null;
@ -372,7 +372,7 @@ class wpdb {
function bail($message) { // Just wraps errors in a nice header and footer function bail($message) { // Just wraps errors in a nice header and footer
if ( !$this->show_errors ) if ( !$this->show_errors )
return false; return false;
header('Content-Type: text/html; charset=utf-8'); header('Content-Type: text/html; charset=utf-8');
if (strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false) if (strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false)

View File

@ -117,7 +117,7 @@ for ($i=1; $i <= $count; $i++) :
$content = strip_tags($content[1], '<img><p><br><i><b><u><em><strong><strike><font><span><div>'); $content = strip_tags($content[1], '<img><p><br><i><b><u><em><strong><strike><font><span><div>');
} }
$content = trim($content); $content = trim($content);
if (stripos($content_transfer_encoding, "quoted-printable") !== false) { if (stripos($content_transfer_encoding, "quoted-printable") !== false) {
$content = quoted_printable_decode($content); $content = quoted_printable_decode($content);
} }

View File

@ -146,7 +146,7 @@ if ( !is_blog_installed() && (strpos($_SERVER['PHP_SELF'], 'install.php') === fa
$link = 'install.php'; $link = 'install.php';
else else
$link = 'wp-admin/install.php'; $link = 'wp-admin/install.php';
wp_die( sprintf( 'It doesn&#8217;t look like you&#8217;ve installed WP yet. Try running <a href="%s">install.php</a>.', $link ) ); wp_die( sprintf( 'It doesn&#8217;t look like you&#8217;ve installed WP yet. Try running <a href="%s">install.php</a>.', $link ) );
} }

View File

@ -505,7 +505,7 @@ class wp_xmlrpc_server extends IXR_Server {
if(empty($category["description"])) { if(empty($category["description"])) {
$category["description"] = ""; $category["description"] = "";
} }
$new_category = array( $new_category = array(
"cat_name" => $category["name"], "cat_name" => $category["name"],
"category_nicename" => $category["slug"], "category_nicename" => $category["slug"],
@ -784,7 +784,7 @@ class wp_xmlrpc_server extends IXR_Server {
if (!$this->login_pass_ok($user_login, $user_pass)) { if (!$this->login_pass_ok($user_login, $user_pass)) {
return $this->error; return $this->error;
} }
$cap = ($publish) ? 'publish_posts' : 'edit_posts'; $cap = ($publish) ? 'publish_posts' : 'edit_posts';
$user = set_current_user(0, $user_login); $user = set_current_user(0, $user_login);
if ( !current_user_can($cap) ) if ( !current_user_can($cap) )
@ -1216,7 +1216,7 @@ class wp_xmlrpc_server extends IXR_Server {
if(isset($content_struct["mt_allow_comments"])) { if(isset($content_struct["mt_allow_comments"])) {
$comment_status = (int) $content_struct["mt_allow_comments"]; $comment_status = (int) $content_struct["mt_allow_comments"];
} }
// Do some timestamp voodoo // Do some timestamp voodoo
$dateCreatedd = $content_struct['dateCreated']; $dateCreatedd = $content_struct['dateCreated'];
if (!empty($dateCreatedd)) { if (!empty($dateCreatedd)) {