Changeset 1034
- Timestamp:
- 06/03/07 03:30:01 (1 year ago)
- Files:
-
- trunk/dev/script/compare-wordpress-code (modified) (1 diff)
- trunk/dev/script/compare-wordpress-structure (modified) (1 diff)
- trunk/src/lyceum/wp-admin/admin-db.php (modified) (4 diffs)
- trunk/src/lyceum/wp-admin/admin-functions.php (modified) (11 diffs)
- trunk/src/lyceum/wp-admin/bookmarklet.php (modified) (1 diff)
- trunk/src/lyceum/wp-admin/edit-comments.php (modified) (1 diff)
- trunk/src/lyceum/wp-admin/import/livejournal.php (modified) (1 diff)
- trunk/src/lyceum/wp-admin/import/mt.php (modified) (2 diffs)
- trunk/src/lyceum/wp-admin/post.php (modified) (1 diff)
- trunk/src/lyceum/wp-admin/upgrade.php (modified) (2 diffs)
- trunk/src/lyceum/wp-comments-post.php (modified) (3 diffs)
- trunk/src/lyceum/wp-includes/classes.php (modified) (1 diff)
- trunk/src/lyceum/wp-includes/comment-functions.php (modified) (3 diffs)
- trunk/src/lyceum/wp-includes/default-filters.php (modified) (1 diff)
- trunk/src/lyceum/wp-includes/functions-formatting.php (modified) (1 diff)
- trunk/src/lyceum/wp-includes/functions.php (modified) (8 diffs)
- trunk/src/lyceum/wp-includes/functions-post.php (modified) (6 diffs)
- trunk/src/lyceum/wp-includes/links.php (modified) (1 diff)
- trunk/src/lyceum/wp-includes/pluggable-functions.php (modified) (2 diffs)
- trunk/src/lyceum/wp-includes/registration-functions.php (modified) (2 diffs)
- trunk/src/lyceum/wp-includes/template-functions-author.php (modified) (1 diff)
- trunk/src/lyceum/wp-includes/template-functions-category.php (modified) (1 diff)
- trunk/src/lyceum/wp-includes/template-functions-general.php (modified) (6 diffs)
- trunk/src/lyceum/wp-includes/template-functions-links.php (modified) (7 diffs)
- trunk/src/lyceum/wp-includes/version.php (modified) (1 diff)
- trunk/src/lyceum/wp-login.php (modified) (1 diff)
- trunk/src/lyceum/wp-trackback.php (modified) (1 diff)
- trunk/src/lyceum/xmlrpc.php (modified) (23 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/dev/script/compare-wordpress-code
r1014 r1034 4 4 5 5 #hardcode this to the version of wordpress you want to compare 6 WP=../../../../wordpress/tags/2.0. 96 WP=../../../../wordpress/tags/2.0.10 7 7 8 8 left=$WP/$2 trunk/dev/script/compare-wordpress-structure
r1014 r1034 11 11 12 12 # hardcode this to the version of wordpress you want to compare 13 WP=../../../../wordpress/tags/2.0.1 13 WP=../../../../wordpress/tags/2.0.10 14 14 15 15 echo '.svn' > /tmp/diffexcludes trunk/src/lyceum/wp-admin/admin-db.php
r1005 r1034 117 117 if (!$update) { 118 118 $wpdb->query("INSERT INTO $wpdb->categories (cat_ID, cat_name, category_nicename, category_description, category_parent, blog) VALUES ('0', '$cat_name', '$category_nicename', '$category_description', '$category_parent', '$blog')"); 119 $cat_ID = $wpdb->insert_id;119 $cat_ID = (int) $wpdb->insert_id; 120 120 } else { 121 121 $wpdb->query ("UPDATE $wpdb->categories SET cat_name = '$cat_name', category_nicename = '$category_nicename', category_description = '$category_description', category_parent = '$category_parent' WHERE cat_ID = '$cat_ID'"); … … 215 215 return 0; 216 216 217 return $wpdb->get_var("SELECT cat_ID FROM $wpdb->categories WHERE blog='$blog' AND category_nicename = '$category_nicename'");217 return (int) $wpdb->get_var("SELECT cat_ID FROM $wpdb->categories WHERE blog='$blog' AND category_nicename = '$category_nicename'"); 218 218 } 219 219 … … 304 304 $update = true; 305 305 306 $link_id = (int) $link_id; 307 306 308 if( trim( $link_name ) == '' ) 307 309 return 0; … … 360 362 } else { 361 363 $wpdb->query("INSERT INTO $wpdb->links (link_url, link_name, link_image, link_target, link_category, link_description, link_visible, link_owner, link_rating, link_rel, link_notes, link_rss) VALUES('$link_url','$link_name', '$link_image', '$link_target', '$link_category', '$link_description', '$link_visible', '$link_owner', '$link_rating', '$link_rel', '$link_notes', '$link_rss')"); 362 $link_id = $wpdb->insert_id;364 $link_id = (int) $wpdb->insert_id; 363 365 } 364 366 trunk/src/lyceum/wp-admin/admin-functions.php
r1006 r1034 290 290 $text = wp_specialchars(stripslashes(urldecode($_REQUEST['text']))); 291 291 $text = funky_javascript_fix($text); 292 $popupurl = attribute_escape(stripslashes($_REQUEST['popupurl']));292 $popupurl = clean_url(stripslashes($_REQUEST['popupurl'])); 293 293 $post_content = '<a href="'.$popupurl.'">'.$post_title.'</a>'."\n$text"; 294 294 } … … 340 340 $user->user_login = attribute_escape($user->user_login); 341 341 $user->user_email = attribute_escape($user->user_email); 342 $user->user_url = attribute_escape($user->user_url);342 $user->user_url = clean_url($user->user_url); 343 343 $user->first_name = attribute_escape($user->first_name); 344 344 $user->last_name = attribute_escape($user->last_name); … … 364 364 if ($user_id != 0) { 365 365 $update = true; 366 $user->ID = $user_id;366 $user->ID = (int) $user_id; 367 367 $userdata = get_userdata($user_id); 368 368 $user->user_login = $wpdb->escape($userdata->user_login); … … 391 391 $user->user_email = wp_specialchars(trim($_POST['email'])); 392 392 if (isset ($_POST['url'])) { 393 $user->user_url = wp_specialchars(trim($_POST['url']));393 $user->user_url = clean_url(trim($_POST['url'])); 394 394 $user->user_url = preg_match('/^(https?|ftps?|mailto|news|gopher):/is', $user->user_url) ? $user->user_url : 'http://'.$user->user_url; 395 395 } … … 476 476 $link = get_link($link_id); 477 477 478 $link->link_url = attribute_escape($link->link_url);478 $link->link_url = clean_url($link->link_url); 479 479 $link->link_name = attribute_escape($link->link_name); 480 480 $link->link_image = attribute_escape($link->link_image); 481 481 $link->link_description = attribute_escape($link->link_description); 482 $link->link_rss = attribute_escape($link->link_rss);482 $link->link_rss = clean_url($link->link_rss); 483 483 $link->link_rel = attribute_escape($link->link_rel); 484 484 $link->link_notes = wp_specialchars($link->link_notes); … … 490 490 function get_default_link_to_edit() { 491 491 if ( isset($_GET['linkurl']) ) 492 $link->link_url = attribute_escape($_GET['linkurl']);492 $link->link_url = clean_url($_GET['linkurl']); 493 493 else 494 494 $link->link_url = ''; … … 511 511 512 512 $_POST['link_url'] = wp_specialchars($_POST['link_url']); 513 $_POST['link_url'] = preg_match('/^(https?|ftps?|mailto|news|gopher):/is', $_POST['link_url']) ? $_POST['link_url'] : 'http://' . $_POST['link_url'];513 $_POST['link_url'] = clean_url($_POST['link_url']); 514 514 $_POST['link_name'] = wp_specialchars($_POST['link_name']); 515 515 $_POST['link_image'] = wp_specialchars($_POST['link_image']); 516 $_POST['link_rss'] = wp_specialchars($_POST['link_rss']);516 $_POST['link_rss'] = clean_url($_POST['link_rss']); 517 517 $auto_toggle = get_autotoggle($_POST['link_category']); 518 518 … … 881 881 <td valign='top'><input name='meta[{$entry['meta_id']}][key]' tabindex='6' type='text' size='20' value='{$entry['meta_key']}' /></td> 882 882 <td><textarea name='meta[{$entry['meta_id']}][value]' tabindex='6' rows='2' cols='30'>{$entry['meta_value']}</textarea></td> 883 <td align='center'><input name='updatemeta' type='submit' class='updatemeta' tabindex='6' value='". __('Update')."' /><br />884 <input name='deletemeta[{$entry['meta_id']}]' type='submit' class='deletemeta' tabindex='6' value='". __('Delete')."' /></td>883 <td align='center'><input name='updatemeta' type='submit' class='updatemeta' tabindex='6' value='".attribute_escape(__('Update'))."' /><br /> 884 <input name='deletemeta[{$entry['meta_id']}]' type='submit' class='deletemeta' tabindex='6' value='".attribute_escape(__('Delete'))."' /></td> 885 885 </tr> 886 886 "; … … 955 955 function add_meta($post_ID) { 956 956 global $wpdb; 957 $post_ID = (int) $post_ID; 957 958 958 959 $metakeyselect = $wpdb->escape(stripslashes(trim($_POST['metakeyselect']))); … … 981 982 function delete_meta($mid) { 982 983 global $wpdb; 984 $mid = (int) $mid; 983 985 984 986 $result = $wpdb->query("DELETE FROM $wpdb->postmeta WHERE meta_id = '$mid'"); … … 1843 1845 } 1844 1846 </script> 1845 <form enctype="multipart/form-data" id="uploadForm" method="post" action="<?php echo $action?>">1847 <form enctype="multipart/form-data" id="uploadForm" method="post" action="<?php echo attribute_escape($action) ?>"> 1846 1848 <label for="upload"><?php _e('File:'); ?></label><input type="file" id="upload" name="import" /> 1847 1849 <input type="hidden" name="action" value="save" /> trunk/src/lyceum/wp-admin/bookmarklet.php
r1006 r1034 38 38 39 39 $content = wp_specialchars($_REQUEST['content']); 40 $popupurl = attribute_escape(stripslashes($_REQUEST['popupurl']));40 $popupurl = clean_url(stripslashes($_REQUEST['popupurl'])); 41 41 if ( !empty($content) ) { 42 42 $post->post_content = wp_specialchars( stripslashes($_REQUEST['content']) ); trunk/src/lyceum/wp-admin/edit-comments.php
r1006 r1034 47 47 foreach ($_POST['delete_comments'] as $comment) : // Check the permissions on each 48 48 $comment = (int) $comment; 49 $post_id = $wpdb->get_var("SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID = $comment");49 $post_id = (int) $wpdb->get_var("SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID = $comment"); 50 50 $authordata = get_userdata( $wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = $post_id") ); 51 51 if ( current_user_can('edit_post', $post_id) ) : trunk/src/lyceum/wp-admin/import/livejournal.php
r1005 r1034 125 125 126 126 if ( $comments ) { 127 $comment_post_ID = $post_id;127 $comment_post_ID = (int) $post_id; 128 128 $num_comments = 0; 129 129 foreach ($comments as $comment) { trunk/src/lyceum/wp-admin/import/mt.php
r1005 r1034 177 177 } 178 178 $this->file = $file['file']; 179 $this->id = $file['id'];179 $this->id = (int) $file['id']; 180 180 181 181 $this->get_entries(); … … 301 301 } 302 302 303 $comment_post_ID = $post_id;303 $comment_post_ID = (int) $post_id; 304 304 $comment_approved = 1; 305 305 trunk/src/lyceum/wp-admin/post.php
r1029 r1034 87 87 <div id='preview' class='wrap'> 88 88 <h2 id="preview-post"><?php _e('Post Preview (updated when post is saved)'); ?> <small class="quickjump"><a href="#write-post"><?php _e('edit ↑'); ?></a></small></h2> 89 <iframe src="<?php echo attribute_escape(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post->ID)))); ?>" width="100%" height="600" ></iframe>89 <iframe src="<?php echo clean_url(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post->ID)))); ?>" width="100%" height="600" ></iframe> 90 90 </div> 91 91 <?php trunk/src/lyceum/wp-admin/upgrade.php
r1006 r1034 77 77 78 78 case 0: 79 $goback = attribute_escape(stripslashes(wp_get_referer()));79 $goback = clean_url(stripslashes(wp_get_referer())); 80 80 ?> 81 81 <p><?php _e('This file upgrades your Lyceum installation from any previos version to the latest. It is very important to read the documentation in doc/Update.en.txt before proceding.'); ?></p> … … 97 97 $backto = LURL; 98 98 else 99 $backto = attribute_escape(stripslashes($_GET['backto']));99 $backto = clean_url(stripslashes($_GET['backto'])); 100 100 ?> 101 101 <h2><?php _e('Step 1'); ?></h2> trunk/src/lyceum/wp-comments-post.php
r1005 r1034 29 29 30 30 // If the user is logged in 31 get_currentuserinfo(); 32 if ( $user_ID ) { 33 $comment_author = $wpdb->escape($user_identity); 34 $comment_author_email = $wpdb->escape($user_email); 35 $comment_author_url = $wpdb->escape($user_url); 36 37 if ( get_option('comment_priviliges') && !is_array($userdata->capabilities) ){ 38 die( __('Sorry, you must have permissions on this blog to post a comment.') );} 31 $user = wp_get_current_user(); 32 if ( $user->ID ) { 33 $comment_author = $wpdb->escape($user->display_name); 34 $comment_author_email = $wpdb->escape($user->user_email); 35 $comment_author_url = $wpdb->escape($user->user_url); 36 if ( current_user_can('unfiltered_html') ) { 37 if ( wp_create_nonce('unfiltered-html-comment_' . $comment_post_ID) != $_POST['_wp_unfiltered_html_comment'] ) { 38 kses_remove_filters(); // start with a clean slate 39 kses_init_filters(); // set up the filters 40 } 41 } 42 if ( get_option('comment_priviliges') && !is_array($userdata->capabilities) ) 43 die( __('Sorry, you must have permissions on this blog to post a comment.') ); 39 44 } else { 40 45 if ( get_option('comment_registration') ) … … 44 49 $comment_type = ''; 45 50 46 if ( get_settings('require_name_email') && !$user _ID ) {51 if ( get_settings('require_name_email') && !$user->ID ) { 47 52 if ( 6 > strlen($comment_author_email) || '' == $comment_author ) 48 53 die( __('Error: please fill the required fields (name, email).') ); … … 58 63 $comment_id = wp_new_comment( $commentdata ); 59 64 60 if ( !$user _ID ) :65 if ( !$user->ID ) : 61 66 $comment = get_comment($comment_id); 62 67 setcookie('comment_author_' . COOKIEHASH, $comment->comment_author, time() + 30000000, COOKIEPATH, COOKIE_DOMAIN); trunk/src/lyceum/wp-includes/classes.php
r1025 r1034 1660 1660 else 1661 1661 $this->query_vars[$wpvar] = ''; 1662 1663 if ( !empty( $this->query_vars[$wpvar] ) ) 1664 $this->query_vars[$wpvar] = (string) $this->query_vars[$wpvar]; 1662 1665 } 1663 1666 trunk/src/lyceum/wp-includes/comment-functions.php
r1006 r1034 2 2 3 3 // Template functions 4 5 function wp_comment_form_unfiltered_html_nonce() { 6 global $post; 7 if ( current_user_can('unfiltered_html') ) 8 wp_nonce_field('unfiltered-html-comment_' . $post->ID, '_wp_unfiltered_html_comment', false); 9 } 4 10 5 11 function comments_template( $file = '/comments.php' ) { … … 85 91 "); 86 92 87 $id = $wpdb->insert_id;93 $id = (int) $wpdb->insert_id; 88 94 89 95 if ( $comment_approved == 1) { … … 234 240 235 241 if ( !$post_id ) 236 $post_id = $id;242 $post_id = (int) $id; 237 243 238 244 if ( !isset($comment_count_cache[$post_id]) ) trunk/src/lyceum/wp-includes/default-filters.php
r1005 r1034 33 33 add_filter('pre_comment_author_email', 'wp_filter_kses'); 34 34 add_filter('pre_comment_author_url', 'wp_filter_kses'); 35 36 add_action('comment_form', 'wp_comment_form_unfiltered_html_nonce'); 35 37 36 38 // Default filters for these functions trunk/src/lyceum/wp-includes/functions-formatting.php
r1006 r1034 1053 1053 $url = str_replace($strip, '', $url); 1054 1054 $url = str_replace(';//', '://', $url); 1055 $url = (!strstr($url, '://')) ? 'http://'.$url : $url; 1055 // Append http unless a relative link starting with / or a php file. 1056 if ( strpos($url, '://') === false && 1057 substr( $url, 0, 1 ) != '/' && !preg_match('/^[a-z0-9]+?\.php/i', $url) ) 1058 $url = 'http://' . $url; 1059 1056 1060 $url = preg_replace('/&([^#])(?![a-z]{2,8};)/', '&$1', $url); 1057 1061 if ( !is_array($protocols) ) trunk/src/lyceum/wp-includes/functions.php
r1018 r1034 172 172 function get_usernumposts($userid) { 173 173 global $wpdb; 174 $userid = (int) $userid; 174 175 return $wpdb->get_post_var("COUNT(DISTINCT $wpdb->posts.ID)", "post_author = '$userid' AND post_status = 'publish'"); 175 176 } … … 638 639 $_post = & $post_cache[$post->ID]; 639 640 } else { 641 $post = (int) $post; 640 642 if ( $_post = wp_cache_get($post, 'pages') ) 641 643 return get_page($_post, $output); … … 741 743 $_page = $page; 742 744 } else { 745 $page = (int) $page; 743 746 if ( isset($GLOBALS['page']) && ($page == $GLOBALS['page']->ID) ) { 744 747 $_page = & $GLOBALS['page']; … … 799 802 $_category = $category; 800 803 } else { 804 $category = (int) $category; 801 805 if ( ! $_category = wp_cache_get($category, 'category') ) { 802 806 $_category = $wpdb->get_row("SELECT * FROM $wpdb->categories WHERE cat_ID = '$category' LIMIT 1"); … … 836 840 $_comment = & $comment_cache[$comment->comment_ID]; 837 841 } else { 842 $comment = (int) $comment; 838 843 if ( !isset($comment_cache[$comment]) ) { 839 844 $_comment = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID = '$comment' LIMIT 1"); … … 2067 2072 global $wp_query; 2068 2073 2069 $id = $wp_query->post->ID;2074 $id = (int) $wp_query->post->ID; 2070 2075 $template = get_post_meta($id, '_wp_page_template', true); 2071 2076 … … 2442 2447 } 2443 2448 2444 function wp_nonce_field($action = -1) { 2445 echo '<input type="hidden" name="_wpnonce" value="' . wp_create_nonce($action) . '" />'; 2446 wp_referer_field(); 2449 function wp_nonce_field($action = -1, $name = "_wpnonce", $referer = true) { 2450 $name = attribute_escape($name); 2451 echo '<input type="hidden" name="' . $name . '" value="' . wp_create_nonce($action) . '" />'; 2452 if ( $referer ) 2453 wp_referer_field(); 2447 2454 } 2448 2455 … … 2559 2566 $html .= "\t\t<div id='message' class='confirm fade'>\n\t\t<p>" . wp_specialchars(wp_explain_nonce($action)) . "</p>\n\t\t<p><a href='$adminurl'>" . __('No') . "</a> <input type='submit' value='" . __('Yes') . "' /></p>\n\t\t</div>\n\t</form>\n"; 2560 2567 } else { 2561 $html .= "\t<div id='message' class='confirm fade'>\n\t<p>" . wp_specialchars(wp_explain_nonce($action)) . "</p>\n\t<p><a href='$adminurl'>" . __('No') . "</a> <a href='" . attribute_escape(add_query_arg('_wpnonce', wp_create_nonce($action), $_SERVER['REQUEST_URI'])) . "'>" . __('Yes') . "</a></p>\n\t</div>\n";2568 $html .= "\t<div id='message' class='confirm fade'>\n\t<p>" . wp_specialchars(wp_explain_nonce($action)) . "</p>\n\t<p><a href='$adminurl'>" . __('No') . "</a> <a href='" . clean_url(add_query_arg('_wpnonce', wp_create_nonce($action), $_SERVER['REQUEST_URI'])) . "'>" . __('Yes') . "</a></p>\n\t</div>\n"; 2562 2569 } 2563 2570 $html .= "</body>\n</html>"; trunk/src/lyceum/wp-includes/functions-post.php
r1006 r1034 49 49 // Get the post ID. 50 50 if ( $update ) 51 $post_ID = $ID;51 $post_ID = (int) $ID; 52 52 53 53 // Create a valid post name. Drafts are allowed to have an empty … … 438 438 439 439 // Set the limit clause, if we got a limit 440 $num = (int) $num; 440 441 if ($num) { 441 442 $limit = "LIMIT $num"; … … 507 508 function wp_set_post_cats($blogid = '1', $post_ID = 0, $post_categories = array()) { 508 509 global $wpdb; 510 511 $post_ID = (int) $post_ID; 512 509 513 // If $post_categories isn't already an array, make it one: 510 514 if (!is_array($post_categories) || 0 == count($post_categories)) … … 517 521 SELECT category_id 518 522 FROM $wpdb->post2cat 519 WHERE post_id = $post_ID");523 WHERE post_id = '$post_ID'"); 520 524 521 525 if (!$old_categories) { … … 532 536 $wpdb->query(" 533 537 DELETE FROM $wpdb->post2cat 534 WHERE category_id = $del535 AND post_id = $post_ID538 WHERE category_id = '$del' 539 AND post_id = '$post_ID' 536 540 "); 537 541 } … … 543 547 if ($add_cats) { 544 548 foreach ($add_cats as $new_cat) { 545 $wpdb->query(" 546 INSERT INTO $wpdb->post2cat (post_id, category_id) 547 VALUES ($post_ID, $new_cat)"); 548 } 549 } 550 549 $new_cat = (int) $new_cat; 550 if ( !empty($new_cat) ) 551 $wpdb->query(" 552 INSERT INTO $wpdb->post2cat (post_id, category_id) 553 VALUES ('$post_ID', '$new_cat')"); 554 } 555 } 556 551 557 // Update category counts. 552 558 $all_affected_cats = array_unique(array_merge($post_categories, $old_categories)); trunk/src/lyceum/wp-includes/links.php
r1011 r1034 224 224 $the_link = '#'; 225 225 if (!empty($row->link_url)) 226 $the_link = attribute_escape($row->link_url);226 $the_link = clean_url($row->link_url); 227 227 228 228 $rel = $row->link_rel; trunk/src/lyceum/wp-includes/pluggable-functions.php
r1006 r1034 490 490 function wp_verify_nonce($nonce, $action = -1) { 491 491 $user = wp_get_current_user(); 492 $uid = $user->id;492 $uid = (int) $user->id; 493 493 494 494 $i = ceil(time() / 43200); … … 504 504 function wp_create_nonce($action = -1) { 505 505 $user = wp_get_current_user(); 506 $uid = $user->id;506 $uid = (int) $user->id; 507 507 508 508 $i = ceil(time() / 43200); trunk/src/lyceum/wp-includes/registration-functions.php
r1003 r1034 93 93 $query = apply_filters('update_user_query', $query); 94 94 $wpdb->query( $query ); 95 $user_id = $ID;95 $user_id = (int) $ID; 96 96 } else { 97 97 $query = "INSERT INTO $wpdb->users … … 101 101 $query = apply_filters('create_user_query', $query); 102 102 $wpdb->query( $query ); 103 $user_id = $wpdb->insert_id;103 $user_id = (int) $wpdb->insert_id; 104 104 } 105 105 trunk/src/lyceum/wp-includes/template-functions-author.php
r1006 r1034 137 137 function get_author_link($echo = false, $author_id, $author_nicename = '') { 138 138 global $wpdb, $wp_rewrite, $post, $cache_userdata; 139 $auth_ID = $author_id;139 $auth_ID = (int) $author_id; 140 140 $link = $wp_rewrite->get_author_permastruct(); 141 141 trunk/src/lyceum/wp-includes/template-functions-category.php
r1006 r1034 4 4 global $post, $category_cache; 5 5 6 $id = (int) $id; 6 7 if ( !$id ) 7 $id = $post->ID;8 $id = (int) $post->ID; 8 9 9 10 if ( !isset($category_cache[$id]) ) trunk/src/lyceum/wp-includes/template-functions-general.php
r1006 r1034 139 139 140 140 function wp_title($sep = '»', $display = true) { 141 global $wpdb; 142 global $m, $year, $monthnum, $day, $category_name, $month, $posts; 141 global $wpdb, $posts, $month; 143 142 144 143 $cat = get_query_var('cat'); … … 148 147 $author = get_query_var('author'); 149 148 $author_name = get_query_var('author_name'); 149 $m = (int) get_query_var('m'); 150 $year = (int) get_query_var('year'); 151 $monthnum = (int) get_query_var('monthnum'); 152 $day = (int) get_query_var('day'); 153 $title = ''; 150 154 151 155 // If there's a category … … 153 157 // category exclusion 154 158 if ( !stristr($cat,'-') ) 155 $title = get_the_category_by_ID($cat); 156 } 157 if ( !empty($category_name) ) { 159 $title = apply_filters('single_cat_title', get_the_category_by_ID($cat)); 160 } elseif ( !empty($category_name) ) { 158 161 if ( stristr($category_name,'/') ) { 159 162 $category_name = explode('/',$category_name); … … 164 167 } 165 168 $title = $wpdb->get_var("SELECT cat_name FROM $wpdb->categories WHERE blog = '$blog' AND category_nicename = '$category_name'"); 169 $title = apply_filters('single_cat_title', $title); 166 170 } 167 171 … … 198 202 199 203 $prefix = ''; 200 if ( isset($title) )204 if ( !empty($title) ) 201 205 $prefix = " $sep "; 202 206 … … 246 250 247 251 function single_month_title($prefix = '', $display = true ) { 248 global $m, $monthnum, $month, $year; 252 global $month; 253 254 $m = (int) get_query_var('m'); 255 $year = (int) get_query_var('year'); 256 $monthnum = (int) get_query_var('monthnum'); 257 249 258 if ( !empty($monthnum) && !empty($year) ) { 250 259 $my_year = $year; trunk/src/lyceum/wp-includes/template-functions-links.php
r1025 r1034 88 88 global $post, $wp_rewrite; 89 89 90 $id = (int) $id; 90 91 if ( !$id ) 91 $id = $post->ID;92 $id = (int) $post->ID; 92 93 93 94 $pagestruct = $wp_rewrite->get_page_permastruct(); … … 110 111 111 112 if (! $id) { 112 $id = $post->ID;113 $id = (int) $post->ID; 113 114 } 114 115 … … 404 405 global $wp_rewrite; 405 406 406 $qstr = wp_specialchars($_SERVER['REQUEST_URI']);407 $qstr = $_SERVER['REQUEST_URI']; 407 408 408 409 $page_querystring = "paged"; … … 471 472 } 472 473 473 function next_posts($max_page = 0) { // original by cfactor at cooltux.org474 function get_next_posts_page_link($max_page = 0) { 474 475 global $paged, $pagenow; 475 476 … … 479 480 $nextpage = intval($paged) + 1; 480 481 if ( !$max_page || $max_page >= $nextpage ) 481 echo get_pagenum_link($nextpage); 482 } 482 return get_pagenum_link($nextpage); 483 } 484 } 485 486 function next_posts($max_page = 0) { 487 echo clean_url(get_next_posts_page_link($max_page)); 483 488 } 484 489 … … 506 511 } 507 512 508 509 function previous_posts() { // original by cfactor at cooltux.org 513 function get_previous_posts_page_link() { 510 514 global $paged, $pagenow; 511 515 … … 514 518 if ( $nextpage < 1 ) 515 519 $nextpage = 1; 516 echo get_pagenum_link($nextpage); 517 } 518 } 519 520 return get_pagenum_link($nextpage); 521 } 522 } 523 524 function previous_posts() { 525 echo clean_url(get_previous_posts_page_link()); 526 } 520 527 521 528 function previous_posts_link($label='« Previous Page') { trunk/src/lyceum/wp-includes/version.php
r1014 r1034 3 3 // This just holds the version number, in a separate file so we can bump it without cluttering the SVN 4 4 5 $wp_version = '1.0. 9.0-beta';5 $wp_version = '1.0.10.0-beta'; 6 6 $wp_db_version = 2; 7 7 trunk/src/lyceum/wp-login.php
r1006 r1034 46 46 $user_pass = ''; 47 47 $using_cookie = false; 48 if ( !isset( $_REQUEST['redirect_to'] ) )48 if ( !isset( $_REQUEST['redirect_to'] ) || is_user_logged_in() ) 49 49 $redirect_to ='profile';//$redirect_to = 'wp-admin/'; 50 50 else trunk/src/lyceum/wp-trackback.php
r1006 r1034 86 86 } 87 87 88 $comment_post_ID = $tb_id;88 $comment_post_ID = (int) $tb_id; 89 89 $comment_author = $blog_name; 90 90 $comment_author_email = ''; trunk/src/lyceum/xmlrpc.php
r1016 r1034 210 210 $this->escape($args); 211 211 212 $post_ID =$args[1];213 $user_login = $args[2];214 $user_pass = $args[3];212 $post_ID = (int) $args[1]; 213 $user_login = $args[2]; 214 $user_pass = $args[3]; 215 215 216 216 if (!$this->login_pass_ok($user_login, $user_pass)) { … … 245 245 $this->escape($args); 246 246 247 $blog_ID =$args[1]; /* though we don't use it yet */248 $user_login = $args[2];249 $user_pass = $args[3];250 $num_posts = $args[4];247 $blog_ID = (int) $args[1]; /* though we don't use it yet */ 248 $user_login = $args[2]; 249 $user_pass = $args[3]; 250 $num_posts = $args[4]; 251 251 252 252 if (!$this->login_pass_ok($user_login, $user_pass)) { … … 293 293 $this->escape($args); 294 294 295 $blog_ID = $args[1];295 $blog_ID = (int) $args[1]; 296 296 $user_login = $args[2]; 297 297 $user_pass = $args[3]; … … 327 327 $this->escape($args); 328 328 329 $blog_ID = $args[1];329 $blog_ID = (int) $args[1]; 330 330 $user_login = $args[2]; 331 331 $user_pass = $args[3]; … … 364 364 $this->escape($args); 365 365 366 $blog_ID = $args[1]; /* though we don't use it yet */366 $blog_ID = (int) $args[1]; /* though we don't use it yet */ 367 367 $user_login = $args[2]; 368 368 $user_pass = $args[3]; … … 411 411 $this->escape($args); 412 412 413 $post_ID = $args[1];413 $post_ID = (int) $args[1]; 414 414 $user_login = $args[2]; 415 415 $user_pass = $args[3]; … … 435 435 extract($actual_post); 436 436 437 if ( ('publish' == $post_status) && !current_user_can('publish_posts') ) 438 return new IXR_Error(401, 'Sorry, you do not have the right to publish this post.'); 439 437 440 $post_title = xmlrpc_getposttitle($content); 438 441 $post_category = xmlrpc_getpostcategory($content); … … 458 461 $this->escape($args); 459 462 460 $post_ID = $args[1];463 $post_ID = (int) $args[1]; 461 464 $user_login = $args[2]; 462 465 $user_pass = $args[3]; … … 499 502 $this->escape($args); 500 503 501 $blog_ID = $args[0]; // we will support this in the near future504 $blog_ID = (int) $args[0]; // we will support this in the near future 502 505 $user_login = $args[1]; 503 506 $user_pass = $args[2]; … … 534 537 } 535 538 536 $to_ping = $content_struct['mt_tb_ping_urls']; 539 $to_ping = $content_struct['mt_tb_ping_urls']; 540 if ( is_array($to_ping) ) 541 $to_ping = implode(' ', $to_ping); 537 542 538 543 // Do some timestamp voodoo … … 579 584 $this->escape($args); 580 585 581 $post_ID = $args[0];586 $post_ID = (int) $args[0]; 582 587 $user_login = $args[1]; 583 588 $user_pass = $args[2]; … … 613 618 $post_status = $publish ? 'publish' : 'draft'; 614 619 620 621 if ( ('publish' == $post_status) && !current_user_can('publish_posts') ) 622 return new IXR_Error(401, 'Sorry, you do not have the right to publish this post.'); 623 615 624 if ($post_more) { 616 625 $post_content = $post_content . "\n<!--more-->\n" . $post_more; 617 626 } 618 627 619 $to_ping = $content_struct['mt_tb_ping_urls']; 620 628 $to_ping = $content_struct['mt_tb_ping_urls']; 629 if ( is_array($to_ping) ) 630 $to_ping = implode(' ', $to_ping); 631 621 632 $comment_status = (empty($content_struct['mt_allow_comments'])) ? 622 633 get_settings('default_comment_status') … … 659 670 $this->escape($args); 660 671 661 $post_ID = $args[0];672 $post_ID = (int) $args[0]; 662 673 $user_login = $args[1]; 663 674 $user_pass = $args[2]; … … 714 725 $this->escape($args); 715 726 716 $blog_ID =$args[0];717 $user_login = $args[1];718 $user_pass = $args[2];719 $num_posts =$args[3];727 $blog_ID = (int) $args[0]; 728 $user_login = $args[1]; 729 $user_pass = $args[2]; 730 $num_posts = (int) $args[3]; 720 731 721 732 if (!$this->login_pass_ok($user_login, $user_pass)) { … … 781 792 $this->escape($args); 782 793 783 $blog_ID =$args[0];784 $user_login = $args[1];785 $user_pass = $args[2];794 $blog_ID = (int) $args[0]; 795 $user_login = $args[1]; 796 $user_pass = $args[2]; 786 797 787 798 if (!$this->login_pass_ok($user_login, $user_pass)) { … … 815 826 global $wpdb; 816 827 817 $blog_ID = $wpdb->escape($args[0]);828 $blog_ID = (int) $args[0]; 818 829 $user_login = $wpdb->escape($args[1]); 819 830 $user_pass = $wpdb->escape($args[2]); … … 855 866 $this->escape($args); 856 867 857 $blog_ID =$args[0];858 $user_login = $args[1];859 $user_pass = $args[2];860 $num_posts =$args[3];868 $blog_ID = (int) $args[0]; 869 $user_login = $args[1]; 870 $user_pass = $args[2]; 871 $num
