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" />
</fieldset>
<fieldset><legend><?php _e('Page Type&hellip;'); ?></legend>
<select name='post_status'>
<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
another. This file is not intended to serve as a complete backup of your
blog.
To import this information into a WordPress blog follow these steps:
1. Log into that blog as an administrator.
2. Go to Manage > Import in the blog's admin.
3. Choose "WordPress" from the list of importers.

View File

@ -915,7 +915,7 @@ class AtomParser {
if(count($this->in_content) == 2) {
array_push($this->in_content, ">");
}
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)) {
$this->in_content = array();

View File

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

View File

@ -1,7 +1,7 @@
<?php
class UTW_Import {
function header() {
echo '<div class="wrap">';
echo '<h2>'.__('Import Ultimate Tag Warrior').'</h2>';
@ -23,18 +23,18 @@ class UTW_Import {
echo '</form>';
echo '</div>';
}
function dispatch () {
if ( empty( $_GET['step'] ) ) {
$step = 0;
} else {
$step = (int) $_GET['step'];
}
// load the header
$this->header();
switch ( $step ) {
case 0 :
$this->greet();
@ -52,18 +52,18 @@ class UTW_Import {
$this->cleanup_import();
break;
}
// load the footer
$this->footer();
}
function import_tags ( ) {
echo '<div class="narrow">';
echo '<p><h3>'.__('Reading UTW Tags&#8230;').'</h3></p>';
$tags = $this->get_utw_tags();
// if we didn't get any tags back, that's all there is folks!
if ( !is_array($tags) ) {
echo '<p>' . __('No Tags Found!') . '</p>';
@ -77,37 +77,37 @@ class UTW_Import {
}
add_option('utwimp_tags', $tags);
$count = count($tags);
echo '<p>' . sprintf( __('Done! <strong>%s</strong> tags were read.'), $count ) . '<br /></p>';
echo '<p>' . __('The following tags were found:') . '</p>';
echo '<ul>';
foreach ( $tags as $tag_id => $tag_name ) {
echo '<li>' . $tag_name . '</li>';
}
echo '</ul>';
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 '<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 '</form>';
echo '</div>';
}
function import_posts ( ) {
echo '<div class="narrow">';
echo '<p><h3>'.__('Reading UTW Post Tags&#8230;').'</h3></p>';
@ -128,12 +128,12 @@ class UTW_Import {
}
add_option('utwimp_posts', $posts);
$count = count($posts);
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">';
@ -142,8 +142,8 @@ class UTW_Import {
echo '</div>';
}
function import_t2p ( ) {
echo '<div class="narrow">';
@ -151,7 +151,7 @@ class UTW_Import {
// run that funky magic!
$tags_added = $this->tag2post();
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">';
@ -160,104 +160,104 @@ class UTW_Import {
echo '</div>';
}
function get_utw_tags ( ) {
global $wpdb;
// 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 = $wpdb->get_results($tags_query);
// rearrange these tags into something we can actually use
foreach ( $tags as $tag ) {
$new_tags[$tag->tag_id] = $tag->tag;
}
return $new_tags;
}
function get_utw_posts ( ) {
global $wpdb;
// 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 = $wpdb->get_results($posts_query);
return $posts;
}
function tag2post ( ) {
// get the tags and posts we imported in the last 2 steps
$tags = get_option('utwimp_tags');
$posts = get_option('utwimp_posts');
// null out our results
$tags_added = 0;
// loop through each post and add its tags to the db
foreach ( $posts as $this_post ) {
$the_post = (int) $this_post->post_id;
$the_tag = (int) $this_post->tag_id;
// what's the tag name for that id?
$the_tag = $tags[$the_tag];
// screw it, just try to add the tag
wp_add_post_tags($the_post, $the_tag);
$tags_added++;
}
// that's it, all posts should be linked to their tags properly, pending any errors we just spit out!
return $tags_added;
}
function cleanup_import ( ) {
delete_option('utwimp_tags');
delete_option('utwimp_posts');
$this->done();
}
function done ( ) {
echo '<div class="narrow">';
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>' . __('Now wasn&#8217;t that easy?') . '</p>';
echo '</div>';
}
function UTW_Import ( ) {
// 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>';
}
function process_post($post) {
global $wpdb;
$post_ID = (int) $this->get_tag( $post, 'wp:post_id' );
if ( $post_ID && !empty($this->posts_processed[$post_ID][1]) ) // Processed already
return 0;
// There are only ever one of these
$post_title = $this->get_tag( $post, 'title' );
$post_date = $this->get_tag( $post, 'wp:post_date' );
@ -311,7 +311,7 @@ class WP_Import {
// Memorize old and new ID.
if ( $post_id && $post_ID && $this->posts_processed[$post_ID] )
$this->posts_processed[$post_ID][1] = $post_id; // New ID.
// Add categories.
if (count($categories) > 0) {
$post_cats = array();

View File

@ -3,163 +3,163 @@
class WP_Categories_to_Tags {
var $categories_to_convert = array();
var $all_categories = array();
function header() {
print '<div class="wrap">';
print '<h2>' . __('Convert Categories to Tags') . '</h2>';
}
function footer() {
print '</div>';
}
function populate_all_categories() {
global $wpdb;
$this->all_categories = get_categories('get=all');
}
function welcome() {
$this->populate_all_categories();
print '<div class="narrow">';
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>' . __('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();
} else {
print '<p>'.__('You have no categories to convert!').'</p>';
}
print '</div>';
}
function categories_form() {
print '<form action="admin.php?import=wp-cat2tag&amp;step=2" method="post">';
print '<ul style="list-style:none">';
$hier = _get_term_hierarchy('category');
foreach ($this->all_categories as $category) {
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>';
if (isset($hier[$category->term_id])) {
$this->_category_children($category, $hier);
}
print '</li>';
}
}
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 '</form>';
}
function _category_children($parent, $hier) {
print '<ul style="list-style:none">';
foreach ($hier[$parent->term_id] as $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>';
if (isset($hier[$child->term_id])) {
$this->_category_children($child, $hier);
}
print '</li>';
}
print '</ul>';
}
function _category_exists($cat_id) {
global $wpdb;
$cat_id = (int) $cat_id;
$maybe_exists = category_exists($cat_id);
if ( $maybe_exists ) {
return true;
} else {
return false;
}
}
function convert_them() {
global $wpdb;
if (!isset($_POST['cats_to_convert']) || !is_array($_POST['cats_to_convert'])) {
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 '</div>';
}
if ( empty($this->categories_to_convert) )
$this->categories_to_convert = $_POST['cats_to_convert'];
$hier = _get_term_hierarchy('category');
print '<ul>';
foreach ($this->categories_to_convert as $cat_id) {
$cat_id = (int) $cat_id;
print '<li>' . __('Converting category') . ' #' . $cat_id . '... ';
if (!$this->_category_exists($cat_id)) {
_e('Category doesn\'t exist!');
} else {
$category =& get_category($cat_id);
// 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'");
// 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'");
// Clean the cache
clean_category_cache($category->term_id);
_e('Converted successfully.');
}
print '</li>';
}
print '</ul>';
}
function convert_all_confirm() {
print '<div class="narrow">';
print '<h3>' . __('Confirm') . '</h3>';
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 '<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 '</div>';
}
function convert_all() {
global $wpdb;
$wpdb->query("UPDATE $wpdb->term_taxonomy SET taxonomy = 'post_tag', parent = 0 WHERE taxonomy = 'category'");
clean_category_cache($category->term_id);
}
function init() {
echo '<!--'; print_r($_POST); print_r($_GET); echo '-->';
if (isset($_POST['maybe_convert_all_cats'])) {
$step = 3;
} elseif (isset($_POST['yes_convert_all_cats'])) {
@ -169,9 +169,9 @@ class WP_Categories_to_Tags {
} else {
$step = (isset($_GET['step'])) ? (int) $_GET['step'] : 1;
}
$this->header();
if (!current_user_can('manage_categories')) {
print '<div class="narrow">';
print '<p>' . __('Cheatin&#8217; uh?') . '</p>';
@ -181,24 +181,24 @@ class WP_Categories_to_Tags {
case 1 :
$this->welcome();
break;
case 2 :
$this->convert_them();
break;
case 3 :
$this->convert_all_confirm();
break;
case 4 :
$this->convert_all();
break;
}
}
$this->footer();
}
function WP_Categories_to_Tags() {
// Do nothing.
}

View File

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

View File

@ -138,7 +138,7 @@ function wp_handle_upload( &$file, $overrides = false ) {
if ( ( !$type || !$ext ) && !current_user_can( 'unfiltered_upload' ) )
return $upload_error_handler( $file, __( 'File type does not meet security guidelines. Try another.' ));
if ( !$ext )
$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'))
imageantialias( $dst, true );
imagecopyresampled( $dst, $src, 0, 0, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h );
if ( !$dst_file )

View File

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

View File

@ -392,7 +392,7 @@ function populate_roles_210() {
function populate_roles_230() {
$role = get_role( 'administrator' );
if ( !empty( $role ) ) {
$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');
if ( empty($categories) )
return;
@ -421,7 +421,7 @@ function touch_time( $edit = 1, $for_post = 1 ) {
if ( $for_post )
$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>';
$time_adj = time() + (get_option( 'gmt_offset' ) * 3600 );

View File

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

View File

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

View File

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

View File

@ -19,48 +19,48 @@ if ( isset( $_POST['comment'] ) && is_array( $_POST['comment'] ) ) {
if ( $action == 'update' ) {
check_admin_referer( 'moderate-comments' );
if ( !current_user_can( 'moderate_comments' ) ) {
wp_die( __( 'Your level is not high enough to moderate comments.' ) );
}
$item_ignored = 0;
$item_deleted = 0;
$item_approved = 0;
$item_spam = 0;
foreach ( $comment as $k => $v ) {
if ( $feelinglucky && $v == 'later' ) {
$v = 'delete';
}
switch ( $v ) {
case 'later' :
$item_ignored++;
break;
case 'delete' :
wp_set_comment_status( $k, 'delete' );
$item_deleted++;
break;
case 'spam' :
wp_set_comment_status( $k, 'spam' );
$item_spam++;
break;
case 'approve' :
wp_set_comment_status( $k, 'approve' );
if ( get_option( 'comments_notify' ) == true ) {
wp_notify_postauthor( $k );
}
$item_approved++;
break;
}
}
wp_redirect( basename( __FILE__ ) . '?ignored=' . $item_ignored . '&deleted=' . $item_deleted . '&approved=' . $item_approved . '&spam=' . $item_spam );
exit;
}
@ -77,25 +77,25 @@ if ( isset( $_GET['approved'] ) || isset( $_GET['deleted'] ) || isset( $_GET['sp
$approved = isset( $_GET['approved'] ) ? (int) $_GET['approved'] : 0;
$deleted = isset( $_GET['deleted'] ) ? (int) $_GET['deleted'] : 0;
$spam = isset( $_GET['ignored'] ) ? (int) $_GET['spam'] : 0;
if ( $approved > 0 || $deleted > 0 || $spam > 0 ) {
echo '<div id="moderated" class="updated fade"><p>';
if ( $approved > 0 ) {
printf( __ngettext( '%s comment approved.', '%s comments approved.', $approved ), $approved );
echo '<br />';
}
if ( $deleted > 0 ) {
printf( __ngettext( '%s comment deleted', '%s comments deleted.', $deleted ), $deleted );
echo '<br />';
}
if ( $spam > 0 ) {
printf( __ngettext( '%s comment marked as spam', '%s comments marked as spam', $spam ), $spam );
echo '<br />';
}
echo '</p></div>';
}
}
@ -137,23 +137,23 @@ $comments = array_slice( $comments, $start, $stop );
?>
<h2><?php _e( 'Moderation Queue' ); ?></h2>
<?php
if ( $page_links ) {
echo '<p class="pagenav">' . $page_links . '</p>';
}
?>
<form name="approval" id="approval" action="<?php echo basename( __FILE__ ); ?>" method="post">
<?php wp_nonce_field( 'moderate-comments' ); ?>
<input type="hidden" name="action" value="update" />
<ol id="the-comments-list" class="commentlist">
<?php
$i = 0;
foreach ( $comments as $comment ) {
$class = 'js-unapproved';
if ( $i++ % 2 ) {
$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 _e( 'IP:' ); ?> <a href="http://ws.arin.net/cgi-bin/whois.pl?queryinput=<?php comment_author_IP(); ?>"><?php comment_author_IP(); ?></a>
</p>
<p>
<?php comment_text(); ?>
</p>
@ -189,25 +189,25 @@ $comments = array_slice( $comments, $start, $stop );
}
?>
</ol>
<?php
if ( $page_links ) {
echo '<p class="pagenav">' . $page_links . '</p>';
}
?>
<div id="ajax-response"></div>
<noscript>
<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>
</p>
</noscript>
<p class="submit">
<input type="submit" id="submit" name="submit" value="<?php _e( 'Bulk Moderate Comments &raquo;' ); ?>" />
</p>
<script type="text/javascript">
// <![CDATA[
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>' );
// ]]>
</script>

View File

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

View File

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

View File

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

View File

@ -10,7 +10,7 @@ wp_enqueue_script( 'scriptaculous-dragdrop' );
function wp_widgets_admin_head() {
global $wp_registered_sidebars, $wp_registered_widgets, $wp_registered_widget_controls;
define( 'WP_WIDGETS_WIDTH', 1 + 262 * ( count( $wp_registered_sidebars ) ) );
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" />
<?php
}
$cols = array();
foreach ( $wp_registered_sidebars as $index => $sidebar ) {
$cols[] = '\'' . $index . '\'';
}
$cols = implode( ', ', $cols );
$widgets = array();
foreach ( $wp_registered_widgets as $name => $widget ) {
$widgets[] = '\'' . $widget['id'] . '\'';
@ -179,19 +179,19 @@ do_action( 'sidebar_admin_setup' );
function wp_widget_draggable( $name ) {
global $wp_registered_widgets, $wp_registered_widget_controls;
if ( !isset( $wp_registered_widgets[$name] ) ) {
return;
}
$sanitized_name = sanitize_title( $wp_registered_widgets[$name]['id'] );
$link_title = __( 'Configure' );
$popper = ( isset( $wp_registered_widget_controls[$name] ) )
? ' <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>';
printf( $output, $sanitized_name, $wp_registered_widgets[$name]['name'] . $popper );
}
@ -204,11 +204,11 @@ if ( count( $wp_registered_sidebars ) < 1 ) {
?>
<div class="wrap">
<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>
</div>
<?php
require_once 'admin-footer.php';
exit;
}
@ -221,23 +221,23 @@ if ( empty( $sidebars_widgets ) ) {
if ( isset( $_POST['action'] ) ) {
check_admin_referer( 'widgets-save-widget-order' );
switch ( $_POST['action'] ) {
case 'default' :
$sidebars_widgets = wp_get_widget_defaults();
wp_set_sidebars_widgets( $sidebars_widgets );
break;
case 'save_widget_order' :
$sidebars_widgets = array();
foreach ( $wp_registered_sidebars as $index => $sidebar ) {
$postindex = $index . 'order';
parse_str( $_POST[$postindex], $order );
$new_order = $order[$index];
if ( is_array( $new_order ) ) {
foreach ( $new_order as $sanitized_name ) {
foreach ( $wp_registered_widgets as $name => $widget ) {
@ -248,7 +248,7 @@ if ( isset( $_POST['action'] ) ) {
}
}
}
wp_set_sidebars_widgets( $sidebars_widgets );
break;
}
@ -260,14 +260,14 @@ $inactive_widgets = array();
foreach ( $wp_registered_widgets as $name => $widget ) {
$is_active = false;
foreach ( $wp_registered_sidebars as $index => $sidebar ) {
if ( is_array( $sidebars_widgets[$index] ) && in_array( $name, $sidebars_widgets[$index] ) ) {
$is_active = true;
break;
}
}
if ( !$is_active ) {
$inactive_widgets[] = $name;
}
@ -297,9 +297,9 @@ if ( isset( $_POST['action'] ) ) {
?>
<div class="wrap">
<h2><?php _e( 'Sidebar Arrangement' ); ?></h2>
<p><?php _e( 'You can drag and drop widgets onto your sidebar below.' ); ?></p>
<form id="sbadmin" method="post" onsubmit="serializeAll();">
<p class="submit">
<input type="submit" value="<?php _e( 'Save Changes &raquo;' ); ?>" />
@ -309,17 +309,17 @@ if ( isset( $_POST['action'] ) ) {
foreach ( $wp_registered_sidebars as $index => $sidebar ) {
?>
<input type="hidden" id="<?php echo $index; ?>order" name="<?php echo $index; ?>order" value="" />
<div class="dropzone">
<h3><?php echo $sidebar['name']; ?></h3>
<div id="<?php echo $index; ?>placematt" class="module placemat">
<span class="handle">
<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.' ); ?>
</span>
</div>
<ul id="<?php echo $index; ?>">
<?php
if ( is_array( $sidebars_widgets[$index] ) ) {
@ -333,14 +333,14 @@ if ( isset( $_POST['action'] ) ) {
<?php
}
?>
<br class="clear" />
</div>
<div id="palettediv">
<h3><?php _e( 'Available Widgets' ); ?></h3>
<ul id="palette">
<?php
foreach ( $inactive_widgets as $name ) {
@ -350,7 +350,7 @@ if ( isset( $_POST['action'] ) ) {
<li id="lastmodule"><span></span></li>
</ul>
</div>
<script type="text/javascript">
// <![CDATA[
<?php foreach ( $containers as $container ) { ?>
@ -362,13 +362,13 @@ if ( isset( $_POST['action'] ) ) {
<?php } ?>
// ]]>
</script>
<p class="submit">
<?php wp_nonce_field( 'widgets-save-widget-order' ); ?>
<input type="hidden" name="action" id="action" value="save_widget_order" />
<input type="submit" value="<?php _e( 'Save Changes &raquo;' ); ?>" />
</p>
<div id="controls">
<?php foreach ( $wp_registered_widget_controls as $name => $widget ) { ?>
<div class="hidden" id="<?php echo $widget['id']; ?>control">
@ -381,12 +381,12 @@ if ( isset( $_POST['action'] ) ) {
<?php } ?>
</div>
</form>
<br class="clear" />
</div>
<div id="shadow"> </div>
<?php do_action( 'sidebar_admin_page' ); ?>
<?php require_once 'admin-footer.php'; ?>

View File

@ -109,7 +109,7 @@ class AtomParser {
$fp = fopen("php://input", "r");
while(!feof($fp)) {
$line = fgets($fp, 4096);
if($app_logging) $contents .= $line;
if(!xml_parse($parser, $line)) {
@ -162,7 +162,7 @@ class AtomParser {
if(count($this->in_content) == 2) {
array_push($this->in_content, ">");
}
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)) {
$this->in_content = array();

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -83,7 +83,7 @@ function spawn_cron() {
$cron_url = get_option( 'siteurl' ) . '/wp-cron.php';
$parts = parse_url( $cron_url );
if ($parts['scheme'] == 'https') {
// support for SSL was added in 4.3.0
if (version_compare(phpversion(), '4.3.0', '>=') && function_exists('openssl_open')) {
@ -94,7 +94,7 @@ function spawn_cron() {
} else {
$argyle = @ fsockopen( $parts['host'], $_SERVER['SERVER_PORT'], $errno, $errstr, 0.01 );
}
if ( $argyle )
fputs( $argyle,
"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 &&
substr( $url, 0, 1 ) != '/' && !preg_match('/^[a-z0-9-]+?\.php/i', $url) )
$url = 'http://' . $url;
$url = preg_replace('/&([^#])(?![a-z]{2,8};)/', '&#038;$1', $url);
if ( !is_array($protocols) )
$protocols = array('http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet');

View File

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

View File

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

View File

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

View File

@ -49,7 +49,7 @@ class TinyPspellShell {
$data = shell_exec($this->cmd);
@unlink($this->tmpfile);
$returnData = array();
$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);
$result = $tinyspell->checkWords($words);
break;
case "suggest":
$result = $tinyspell->getSuggestion($check);
break;
@ -138,7 +138,7 @@
header('Content-type: text/xml; charset=utf-8');
$body = '<?xml version="1.0" encoding="utf-8" ?>';
$body .= "\n";
if (count($result) == 0)
$body .= '<res id="' . $id . '" cmd="'. $cmd .'" />';
else

View File

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

View File

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

View File

@ -182,7 +182,7 @@ if (!CUSTOM_TAGS) {
'ol' => array(),
'var' => array()
);
$allowedtags = array(
'a' => 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 ) {
$post = &get_post( $id );
if ( $post->post_type == 'attachment' ) {
return;
} elseif ( $post->post_type == 'page' ) {
if ( !current_user_can( 'edit_page', $post->ID ) )
return;
$file = 'page';
} else {
if ( !current_user_can( 'edit_post', $post->ID ) )
return;
$file = 'post';
}
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' ) {
if ( !current_user_can( 'edit_page', $post->ID ) )
return;
$file = 'page';
} else {
if ( !current_user_can( 'edit_post', $post->ID ) )
return;
$file = 'post';
}
@ -315,7 +315,7 @@ function edit_post_link( $link = 'Edit This', $before = '', $after = '' ) {
function get_edit_comment_link( $comment_id = 0 ) {
$comment = &get_comment( $comment_id );
$post = &get_post( $comment->comment_post_ID );
if ( $post->post_type == 'attachment' ) {
return;
} 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) {
global $wp_rewrite;
$pagenum = (int) $pagenum;
$request = remove_query_arg( 'paged' );
$home_root = parse_url(get_option('home'));
$home_root = $home_root['path'];
$home_root = preg_quote( trailingslashit( $home_root ), '|' );
$request = preg_replace('|^'. $home_root . '|', '', $request);
$request = preg_replace('|^/+|', '', $request);
if ( !$wp_rewrite->using_permalinks() || is_admin() ) {
$base = trailingslashit( get_bloginfo( 'home' ) );
@ -476,29 +476,29 @@ function get_pagenum_link($pagenum = 1) {
} else {
$qs_regex = '|\?.*?$|';
preg_match( $qs_regex, $request, $qs_match );
if ( $qs_match[0] ) {
$query_string = $qs_match[0];
$request = preg_replace( $qs_regex, '', $request );
} else {
$query_string = '';
}
$request = preg_replace( '|page/(.+)/?$|', '', $request);
$base = trailingslashit( get_bloginfo( 'url' ) );
if ( $wp_rewrite->using_index_permalinks() && $pagenum > 1 ) {
$base .= 'index.php/';
}
if ( $pagenum > 1 ) {
$request = ( ( !empty( $request ) ) ? trailingslashit( $request ) : $request ) . user_trailingslashit( 'page/' . $pagenum, 'paged' );
}
$result = $base . $request . $query_string;
}
return $result;
}

View File

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

View File

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

View File

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

View File

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

View File

@ -461,7 +461,7 @@ class WP_Query {
$qv['attachment_id'] = $qv['subpost_id'];
$qv['attachment_id'] = (int) $qv['attachment_id'];
if ( ('' != $qv['attachment']) || !empty($qv['attachment_id']) ) {
$this->is_single = true;
$this->is_attachment = true;
@ -1021,7 +1021,7 @@ class WP_Query {
if ( is_admin() )
$where .= " OR post_status = 'future' OR post_status = 'draft'";
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'";
}

View File

@ -63,7 +63,7 @@ function add_rewrite_endpoint($name, $places) {
// determine the post ID it represents.
function url_to_postid($url) {
global $wp_rewrite;
$url = apply_filters('url_to_postid', $url);
// 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() {
$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( 'sack', '/wp-includes/js/tw-sack.js', false, '1.6.1' );
$this->add( 'quicktags', '/wp-includes/js/quicktags.js', false, '3958' );
$this->localize( 'quicktags', 'quicktagsL10n', array(
'quickLinks' => __('(Quick Links)'),
@ -28,15 +28,15 @@ class WP_Scripts {
'enterImageURL' => __('Enter the URL of the image'),
'enterImageDescription' => __('Enter a description of the image')
) );
$this->add( 'colorpicker', '/wp-includes/js/colorpicker.js', false, '3517' );
$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');
$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( 'autosave', '/wp-includes/js/autosave.js', array('prototype', 'sack'), '20070306');
$this->localize( 'autosave', 'autosaveL10n', array(
'autosaveInterval' => apply_filters('autosave_interval', '120'),
@ -45,7 +45,7 @@ class WP_Scripts {
'requestFile' => get_option( 'siteurl' ) . '/wp-admin/admin-ajax.php',
'savingText' => __('Saving Draft...')
) );
$this->add( 'wp-ajax', '/wp-includes/js/wp-ajax.js', array('prototype'), '20070306');
$this->localize( 'wp-ajax', 'WPAjaxL10n', array(
'defaultUrl' => get_option( 'siteurl' ) . '/wp-admin/admin-ajax.php',
@ -53,13 +53,13 @@ class WP_Scripts {
'strangeText' => __("Something strange happened. Try refreshing the page."),
'whoaText' => __("Slow down, I'm still sending your data!")
) );
$this->add( 'listman', '/wp-includes/js/list-manipulation.js', array('wp-ajax', 'fat'), '20070306' );
$this->localize( 'listman', 'listManL10n', array(
'jumpText' => __('Jump to new item'),
'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-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');
@ -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-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( '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-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');
if ( is_admin() ) {
global $pagenow;
$man = false;
@ -182,11 +182,11 @@ class WP_Scripts {
$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 = $this->scripts[$handle]->src;
if (!preg_match('|^https?://|', $src)) {
$src = get_option('siteurl') . $src;
}
$src = add_query_arg('ver', $ver, $src);
$src = clean_url(apply_filters( 'script_loader_src', $src ));
echo "<script type='text/javascript' src='$src'></script>\n";

View File

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

View File

@ -98,7 +98,7 @@ function wp_insert_term( $term, $taxonomy, $args = array() ) {
$slug = sanitize_title($slug, $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");
if ( !empty($tt_id) )
@ -135,7 +135,7 @@ function wp_delete_object_term_relationships( $object_id, $taxonomies ) {
wp_update_term_count($terms, $taxonomy);
}
// TODO clear the cache
}
@ -239,7 +239,7 @@ function wp_update_term( $term, $taxonomy, $args = array() ) {
$slug = sanitize_title($name, $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");
$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);
}
/**
* 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.
@ -316,7 +316,7 @@ function get_defined_terms($terms) {
$terms = "'" . implode("', '", $searches) . "'";
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
* 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) )
return false;
if ( !is_array($terms) )
$terms = array($terms);

View File

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

View File

@ -188,9 +188,9 @@ function wp_dropdown_users( $args = '' ) {
'show' => 'display_name', 'echo' => 1,
'selected' => 0, 'name' => 'user', 'class' => ''
);
$defaults['selected'] = is_author() ? get_query_var( 'author' ) : 0;
$r = wp_parse_args( $args, $defaults );
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(
100 => 'Continue',
101 => 'Switching Protocols',
200 => 'OK',
201 => 'Created',
202 => 'Accepted',
@ -46,7 +46,7 @@ $wp_header_to_desc = apply_filters( 'wp_header_to_desc_array', array(
204 => 'No Content',
205 => 'Reset Content',
206 => 'Partial Content',
300 => 'Multiple Choices',
301 => 'Moved Permanently',
302 => 'Found',
@ -54,7 +54,7 @@ $wp_header_to_desc = apply_filters( 'wp_header_to_desc_array', array(
304 => 'Not Modified',
305 => 'Use Proxy',
307 => 'Temporary Redirect',
400 => 'Bad Request',
401 => 'Unauthorized',
403 => 'Forbidden',
@ -72,7 +72,7 @@ $wp_header_to_desc = apply_filters( 'wp_header_to_desc_array', array(
415 => 'Unsupported Media Type',
416 => 'Requested Range Not Satisfiable',
417 => 'Expectation Failed',
500 => 'Internal Server Error',
501 => 'Not Implemented',
502 => 'Bad Gateway',

View File

@ -59,7 +59,7 @@ function register_sidebar($args = array()) {
function unregister_sidebar( $name ) {
global $wp_registered_sidebars;
if ( isset( $wp_registered_sidebars[$name] ) )
unset( $wp_registered_sidebars[$name] );
}
@ -329,17 +329,17 @@ function wp_get_widget_defaults() {
function wp_widget_pages( $args ) {
extract( $args );
$options = get_option( 'widget_pages' );
$title = empty( $options['title'] ) ? __( 'Pages' ) : $options['title'];
$sortby = empty( $options['sortby'] ) ? 'menu_order' : $options['sortby'];
$exclude = empty( $options['exclude'] ) ? '' : '&exclude=' . $options['exclude'];
if ( $sortby == 'menu_order' ) {
$sortby = 'menu_order, post_title';
}
$out = wp_list_pages( 'title_li=&echo=0&sort_column=' . $sortby . $exclude );
if ( !empty( $out ) ) {
?>
<?php echo $before_widget; ?>
@ -356,15 +356,15 @@ function wp_widget_pages_control() {
$options = $newoptions = get_option('widget_pages');
if ( $_POST['pages-submit'] ) {
$newoptions['title'] = strip_tags(stripslashes($_POST['pages-title']));
$sortby = stripslashes( $_POST['pages-sortby'] );
if ( in_array( $sortby, array( 'post_title', 'menu_order', 'ID' ) ) ) {
$newoptions['sortby'] = $sortby;
} else {
$newoptions['sortby'] = 'menu_order';
}
$newoptions['exclude'] = strip_tags( stripslashes( $_POST['pages-exclude'] ) );
}
if ( $options != $newoptions ) {
@ -798,7 +798,7 @@ function wp_widget_recent_comments_register() {
$class = array('classname' => 'widget_recent_comments');
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);
if ( is_active_widget('wp_widget_recent_comments') )
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)";
if ( $query )
$this->query($query);
if ( !isset($this->last_result[$y]) )
return null;
@ -372,7 +372,7 @@ class wpdb {
function bail($message) { // Just wraps errors in a nice header and footer
if ( !$this->show_errors )
return false;
header('Content-Type: text/html; charset=utf-8');
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 = trim($content);
if (stripos($content_transfer_encoding, "quoted-printable") !== false) {
$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';
else
$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 ) );
}

View File

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