From ba407ff5b3735aaaed82ea0ee34595d51edfc0a6 Mon Sep 17 00:00:00 2001 From: saxmatt Date: Fri, 7 May 2004 23:56:33 +0000 Subject: [PATCH] E_ALL fixes and cleanups. git-svn-id: http://svn.automattic.com/wordpress/trunk@1239 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/categories.php | 4 +- wp-admin/edit-comments.php | 2 +- wp-admin/edit-form.php | 11 +--- wp-admin/edit.php | 2 +- wp-admin/moderation.php | 5 +- wp-admin/options-head.php | 16 +++--- wp-admin/plugins.php | 22 ++++--- wp-admin/post.php | 67 +++++++++++----------- wp-admin/profile.php | 2 +- wp-admin/templates.php | 2 +- wp-admin/users.php | 3 +- wp-includes/functions-formatting.php | 2 - wp-includes/functions.php | 18 ++---- wp-includes/template-functions-general.php | 1 + wp-login.php | 8 +-- wp-settings.php | 1 + 16 files changed, 73 insertions(+), 93 deletions(-) diff --git a/wp-admin/categories.php b/wp-admin/categories.php index de025126f..7ca65ba5a 100644 --- a/wp-admin/categories.php +++ b/wp-admin/categories.php @@ -2,7 +2,6 @@ require_once('../wp-includes/wp-l10n.php'); $title = __('Categories'); -/* */ function add_magic_quotes($array) { foreach ($array as $k => $v) { @@ -144,7 +143,7 @@ $messages[1] = __('Category added.'); $messages[2] = __('Category deleted.'); $messages[3] = __('Category updated.'); ?> - +

@@ -193,6 +192,5 @@ set them back to the default category %s.'), get_catname(1)) ?> break; } -/*
*/ include('admin-footer.php'); ?> \ No newline at end of file diff --git a/wp-admin/edit-comments.php b/wp-admin/edit-comments.php index 6ec390596..c4e62cfa6 100644 --- a/wp-admin/edit-comments.php +++ b/wp-admin/edit-comments.php @@ -31,7 +31,7 @@ function checkAll(form)
- + diff --git a/wp-admin/edit-form.php b/wp-admin/edit-form.php index 7fb59ac3c..2b511231f 100644 --- a/wp-admin/edit-form.php +++ b/wp-admin/edit-form.php @@ -18,14 +18,6 @@ if (get_settings('use_pingback')) { if (get_settings('use_trackback')) { $form_trackback = '

(Separate multiple URIs with spaces.)
'), 'http://wordpress.org/docs/reference/post/#trackback') . '

'; - if ('' != $pinged) { - $form_trackback .= '

' . __('Already pinged:') . '

    '; - $already_pinged = explode("\n", trim($pinged)); - foreach ($already_pinged as $pinged_url) { - $form_trackback .= "\n\t
  • $pinged_url
  • "; - } - $form_trackback .= '
'; - } } else { $form_trackback = ''; } @@ -38,7 +30,7 @@ $saveasdraft = ''; '; } ?> @@ -98,7 +90,6 @@ edCanvas = document.getElementById('content'); -

diff --git a/wp-admin/edit.php b/wp-admin/edit.php index bd5cdf528..726f58a1a 100644 --- a/wp-admin/edit.php +++ b/wp-admin/edit.php @@ -70,7 +70,7 @@ if( isset( $_GET['m'] ) )

- +
diff --git a/wp-admin/moderation.php b/wp-admin/moderation.php index a758d32c4..cd6ec9d1a 100644 --- a/wp-admin/moderation.php +++ b/wp-admin/moderation.php @@ -103,11 +103,8 @@ default:
  • \n

    "; if ($approved) { if ('1' == $approved) { diff --git a/wp-admin/options-head.php b/wp-admin/options-head.php index 7fb91b929..c1848efce 100644 --- a/wp-admin/options-head.php +++ b/wp-admin/options-head.php @@ -1,10 +1,11 @@ get_results("SELECT group_id, group_name, group_desc, group_longdesc FROM $tableoptiongroups ORDER BY group_id"); foreach ($option_groups as $option_group) { if ($option_group->group_id == $option_group_id) { @@ -28,11 +29,12 @@ $submenu = ' $sublines = split("\n", $submenu); $_SERVER['REQUEST_URI'] = str_replace('?updated=true', '', $_SERVER['REQUEST_URI']); foreach ($sublines as $subline) { - preg_match('/href="([^"]+)"/', $subline, $url); - if (substr($_SERVER['REQUEST_URI'], -8) == substr($url[1], -8)) { - $subline = str_replace('a hr', 'a class="current" hr', $subline); - if (str_replace('/wp-admin/', '', $_SERVER["REQUEST_URI"]) == $url[1]) { - $subline = preg_replace('|href=".*?"|', '', $subline); + if (preg_match('/href="([^"]+)"/', $subline, $url)) { + if (substr($_SERVER['REQUEST_URI'], -8) == substr($url[1], -8)) { + $subline = str_replace('a hr', 'a class="current" hr', $subline); + if (str_replace('/wp-admin/', '', $_SERVER["REQUEST_URI"]) == $url[1]) { + $subline = preg_replace('|href=".*?"|', '', $subline); + } } } echo $subline."\n"; @@ -44,6 +46,6 @@ echo $groups .
    - +

    \ No newline at end of file diff --git a/wp-admin/plugins.php b/wp-admin/plugins.php index cb792e304..889af899b 100644 --- a/wp-admin/plugins.php +++ b/wp-admin/plugins.php @@ -46,11 +46,11 @@ foreach ($check_plugins as $check_plugin) { ?> - +

    activated.') ?>

    - +

    deactivated.') ?>

    @@ -86,6 +86,7 @@ if (!$plugins_dir || !$plugin_files) { {$plugin_name[1]}") ); + $plugin = __("{$plugin_name[1]}"); } if ('' == $author_uri) { $author = $author_name[1]; } else { - $author = wp_filter_kses( __("{$author_name[1]}") ); + $author = __("{$author_name[1]}"); } @@ -121,7 +126,7 @@ if (!$plugins_dir || !$plugin_files) { echo " $plugin - {$version[1]} + $version $author $description $action @@ -136,6 +141,5 @@ if (!$plugins_dir || !$plugin_files) { +?> \ No newline at end of file diff --git a/wp-admin/post.php b/wp-admin/post.php index 13f0b21e4..f9ad7ac2c 100644 --- a/wp-admin/post.php +++ b/wp-admin/post.php @@ -695,42 +695,39 @@ default: require_once ('./admin-header.php'); if ($user_level > 0) { - if ((!$withcomments) && (!$single)) { + $action = 'post'; + get_currentuserinfo(); + $drafts = $wpdb->get_results("SELECT ID, post_title FROM $tableposts WHERE post_status = 'draft' AND post_author = $user_ID"); + if ($drafts) { + ?> +
    +

    + post_title = stripslashes($draft->post_title); + if ($draft->post_title == '') + $draft->post_title = sprintf(__('Post # %s'), $draft->ID); + echo "$draft->post_title"; + ++$i; + } + ?>.

    +
    + get_results("SELECT ID, post_title FROM $tableposts WHERE post_status = 'draft' AND post_author = $user_ID"); - if ($drafts) { - ?> -
    -

    - post_title = stripslashes($draft->post_title); - if ($draft->post_title == '') - $draft->post_title = sprintf(__('Post # %s'), $draft->ID); - echo "$draft->post_title"; - ++$i; - } - ?>.

    -
    -
    diff --git a/wp-admin/profile.php b/wp-admin/profile.php index 198429a02..a4db66efa 100644 --- a/wp-admin/profile.php +++ b/wp-admin/profile.php @@ -224,7 +224,7 @@ default: $bookmarklet_height= (get_settings('use_trackback')) ? 480 : 440; ?> - +

    diff --git a/wp-admin/templates.php b/wp-admin/templates.php index fdde34372..938325289 100644 --- a/wp-admin/templates.php +++ b/wp-admin/templates.php @@ -113,7 +113,7 @@ default: } ?> - +

    diff --git a/wp-admin/users.php b/wp-admin/users.php index cf7d836a2..4b61e1ed9 100644 --- a/wp-admin/users.php +++ b/wp-admin/users.php @@ -164,7 +164,7 @@ default: $standalone = 0; include ('admin-header.php'); ?> - +

    @@ -181,6 +181,7 @@ default: get_results("SELECT ID FROM $tableusers WHERE user_level > 0 ORDER BY ID"); + $style = ''; foreach ($users as $user) { $user_data = get_userdata($user->ID); $email = $user_data->user_email; diff --git a/wp-includes/functions-formatting.php b/wp-includes/functions-formatting.php index 9f2b5ff79..a0270e47a 100644 --- a/wp-includes/functions-formatting.php +++ b/wp-includes/functions-formatting.php @@ -223,9 +223,7 @@ function format_to_edit($content) { function format_to_post($content) { global $wpdb; - $content = stripslashes(stripslashes($content)); $content = apply_filters('format_to_post', $content); - $content = $wpdb->escape($content); return $content; } diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 4586c92b3..d6a77d706 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -1,9 +1,5 @@ post_lat; $lon = $row->post_lon; $title = $row->post_title; @@ -864,9 +856,9 @@ function doGeoUrlHeader($post_list = '') { } else { if(get_settings('use_default_geourl')) { // send the default here - echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; } } } diff --git a/wp-includes/template-functions-general.php b/wp-includes/template-functions-general.php index 9ac56dc90..511d675bc 100644 --- a/wp-includes/template-functions-general.php +++ b/wp-includes/template-functions-general.php @@ -484,6 +484,7 @@ function get_calendar($daylength = 1) { function allowed_tags() { global $allowedtags; + $allowed = ''; foreach($allowedtags as $tag => $attributes) { $allowed .= '<'.$tag; if (0 < count($attributes)) { diff --git a/wp-login.php b/wp-login.php index 262304486..a255fede3 100644 --- a/wp-login.php +++ b/wp-login.php @@ -120,11 +120,9 @@ case 'login': } else { $user_login = $log; $user_pass = $pwd; - setcookie('wordpressuser_'.$cookiehash, $user_login, time()+31536000); - setcookie('wordpresspass_'.$cookiehash, md5($user_pass), time()+31536000); - if (empty($_COOKIE['wordpressblogid_'.$cookiehash])) { - setcookie('wordpressblogid_'.$cookiehash, 1,time()+31536000); - } + setcookie('wordpressuser_'.$cookiehash, $user_login, time() + 31536000, COOKIEPATH); + setcookie('wordpresspass_'.$cookiehash, md5($user_pass), time() + 31536000, COOKIEPATH); + header('Expires: Wed, 11 Jan 1984 05:00:00 GMT'); header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); header('Cache-Control: no-cache, must-revalidate'); diff --git a/wp-settings.php b/wp-settings.php index d03803890..4b58bb116 100644 --- a/wp-settings.php +++ b/wp-settings.php @@ -37,6 +37,7 @@ if (!$users && !strstr($_SERVER['PHP_SELF'], 'install.php')) { $wpdb->show_errors(); require (ABSPATH . WPINC . '/functions.php'); +require (ABSPATH . WPINC . '/functions-formatting.php'); require (ABSPATH . 'wp-config-extra.php'); require (ABSPATH . WPINC . '/template-functions.php'); require (ABSPATH . WPINC . '/links.php');