Log in with username/password: lyceum/lyceum

Changeset 1034

Show
Ignore:
Timestamp:
06/03/07 03:30:01 (1 year ago)
Author:
jjb
Message:

Syncing with WP 2.0.10

svn merge --ignore-ancestry ~/ibiblio/wordpress/tags/2.0.9@HEAD ~/ibiblio/wordpress/tags/2.0.10@HEAD lyceum
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/dev/script/compare-wordpress-code

    r1014 r1034  
    44 
    55#hardcode this to the version of wordpress you want to compare 
    6 WP=../../../../wordpress/tags/2.0.9 
     6WP=../../../../wordpress/tags/2.0.10 
    77 
    88left=$WP/$2  
  • trunk/dev/script/compare-wordpress-structure

    r1014 r1034  
    1111 
    1212# hardcode this to the version of wordpress you want to compare 
    13 WP=../../../../wordpress/tags/2.0.1 
     13WP=../../../../wordpress/tags/2.0.10 
    1414 
    1515echo '.svn' > /tmp/diffexcludes 
  • trunk/src/lyceum/wp-admin/admin-db.php

    r1005 r1034  
    117117   if (!$update) { 
    118118      $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; 
    120120   } else { 
    121121      $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'"); 
     
    215215      return 0; 
    216216 
    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'"); 
    218218} 
    219219 
     
    304304      $update = true; 
    305305 
     306   $link_id = (int) $link_id; 
     307 
    306308   if( trim( $link_name ) == '' ) 
    307309      return 0; 
     
    360362   } else { 
    361363      $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; 
    363365   } 
    364366    
  • trunk/src/lyceum/wp-admin/admin-functions.php

    r1006 r1034  
    290290      $text       = wp_specialchars(stripslashes(urldecode($_REQUEST['text']))); 
    291291      $text       = funky_javascript_fix($text); 
    292       $popupurl   = attribute_escape(stripslashes($_REQUEST['popupurl'])); 
     292      $popupurl   = clean_url(stripslashes($_REQUEST['popupurl'])); 
    293293        $post_content = '<a href="'.$popupurl.'">'.$post_title.'</a>'."\n$text"; 
    294294    } 
     
    340340   $user->user_login   = attribute_escape($user->user_login); 
    341341   $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); 
    343343   $user->first_name   = attribute_escape($user->first_name); 
    344344   $user->last_name    = attribute_escape($user->last_name); 
     
    364364   if ($user_id != 0) { 
    365365      $update = true; 
    366       $user->ID = $user_id; 
     366      $user->ID = (int) $user_id; 
    367367      $userdata = get_userdata($user_id); 
    368368      $user->user_login = $wpdb->escape($userdata->user_login); 
     
    391391      $user->user_email = wp_specialchars(trim($_POST['email'])); 
    392392   if (isset ($_POST['url'])) { 
    393       $user->user_url = wp_specialchars(trim($_POST['url'])); 
     393      $user->user_url = clean_url(trim($_POST['url'])); 
    394394      $user->user_url = preg_match('/^(https?|ftps?|mailto|news|gopher):/is', $user->user_url) ? $user->user_url : 'http://'.$user->user_url; 
    395395   } 
     
    476476   $link = get_link($link_id); 
    477477 
    478    $link->link_url         = attribute_escape($link->link_url); 
     478   $link->link_url         =        clean_url($link->link_url); 
    479479   $link->link_name        = attribute_escape($link->link_name); 
    480480   $link->link_image       = attribute_escape($link->link_image); 
    481481   $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); 
    483483   $link->link_rel         = attribute_escape($link->link_rel); 
    484484   $link->link_notes       =  wp_specialchars($link->link_notes); 
     
    490490function get_default_link_to_edit() { 
    491491   if ( isset($_GET['linkurl']) ) 
    492       $link->link_url = attribute_escape($_GET['linkurl']); 
     492      $link->link_url = clean_url($_GET['linkurl']); 
    493493   else 
    494494      $link->link_url = ''; 
     
    511511 
    512512   $_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'])
    514514   $_POST['link_name'] = wp_specialchars($_POST['link_name']); 
    515515   $_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']); 
    517517   $auto_toggle = get_autotoggle($_POST['link_category']); 
    518518    
     
    881881            <td valign='top'><input name='meta[{$entry['meta_id']}][key]' tabindex='6' type='text' size='20' value='{$entry['meta_key']}' /></td> 
    882882            <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> 
    885885         </tr> 
    886886      "; 
     
    955955function add_meta($post_ID) { 
    956956   global $wpdb; 
     957   $post_ID = (int) $post_ID; 
    957958 
    958959   $metakeyselect = $wpdb->escape(stripslashes(trim($_POST['metakeyselect']))); 
     
    981982function delete_meta($mid) { 
    982983   global $wpdb; 
     984   $mid = (int) $mid; 
    983985 
    984986   $result = $wpdb->query("DELETE FROM $wpdb->postmeta WHERE meta_id = '$mid'"); 
     
    18431845} 
    18441846</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) ?>"> 
    18461848<label for="upload"><?php _e('File:'); ?></label><input type="file" id="upload" name="import" /> 
    18471849<input type="hidden" name="action" value="save" /> 
  • trunk/src/lyceum/wp-admin/bookmarklet.php

    r1006 r1034  
    3838   
    3939$content  = wp_specialchars($_REQUEST['content']); 
    40 $popupurl = attribute_escape(stripslashes($_REQUEST['popupurl'])); 
     40$popupurl = clean_url(stripslashes($_REQUEST['popupurl'])); 
    4141    if ( !empty($content) ) { 
    4242        $post->post_content = wp_specialchars( stripslashes($_REQUEST['content']) ); 
  • trunk/src/lyceum/wp-admin/edit-comments.php

    r1006 r1034  
    4747   foreach ($_POST['delete_comments'] as $comment) : // Check the permissions on each 
    4848      $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"); 
    5050      $authordata = get_userdata( $wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = $post_id") ); 
    5151      if ( current_user_can('edit_post', $post_id) ) : 
  • trunk/src/lyceum/wp-admin/import/livejournal.php

    r1005 r1034  
    125125          
    126126         if ( $comments ) { 
    127             $comment_post_ID = $post_id; 
     127            $comment_post_ID = (int) $post_id; 
    128128            $num_comments = 0; 
    129129            foreach ($comments as $comment) { 
  • trunk/src/lyceum/wp-admin/import/mt.php

    r1005 r1034  
    177177      } 
    178178      $this->file = $file['file']; 
    179       $this->id = $file['id']; 
     179      $this->id = (int) $file['id']; 
    180180 
    181181      $this->get_entries(); 
     
    301301            } 
    302302 
    303             $comment_post_ID = $post_id; 
     303            $comment_post_ID = (int) $post_id; 
    304304            $comment_approved = 1; 
    305305 
  • trunk/src/lyceum/wp-admin/post.php

    r1029 r1034  
    8787   <div id='preview' class='wrap'> 
    8888   <h2 id="preview-post"><?php _e('Post Preview (updated when post is saved)'); ?> <small class="quickjump"><a href="#write-post"><?php _e('edit &uarr;'); ?></a></small></h2> 
    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> 
    9090   </div> 
    9191   <?php 
  • trunk/src/lyceum/wp-admin/upgrade.php

    r1006 r1034  
    7777 
    7878   case 0: 
    79    $goback = attribute_escape(stripslashes(wp_get_referer())); 
     79   $goback = clean_url(stripslashes(wp_get_referer())); 
    8080?>  
    8181<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>  
     
    9797      $backto = LURL; 
    9898   else 
    99       $backto = attribute_escape(stripslashes($_GET['backto'])); 
     99      $backto = clean_url(stripslashes($_GET['backto'])); 
    100100?>  
    101101<h2><?php _e('Step 1'); ?></h2>  
  • trunk/src/lyceum/wp-comments-post.php

    r1005 r1034  
    2929 
    3030// 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(); 
     32if ( $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.') ); 
    3944} else { 
    4045   if ( get_option('comment_registration') ) 
     
    4449$comment_type = ''; 
    4550 
    46 if ( get_settings('require_name_email') && !$user_ID ) { 
     51if ( get_settings('require_name_email') && !$user->ID ) { 
    4752   if ( 6 > strlen($comment_author_email) || '' == $comment_author ) 
    4853      die( __('Error: please fill the required fields (name, email).') ); 
     
    5863$comment_id = wp_new_comment( $commentdata ); 
    5964 
    60 if ( !$user_ID ) : 
     65if ( !$user->ID ) : 
    6166   $comment = get_comment($comment_id); 
    6267   setcookie('comment_author_' . COOKIEHASH, $comment->comment_author, time() + 30000000, COOKIEPATH, COOKIE_DOMAIN); 
  • trunk/src/lyceum/wp-includes/classes.php

    r1025 r1034  
    16601660         else 
    16611661            $this->query_vars[$wpvar] = ''; 
     1662 
     1663         if ( !empty( $this->query_vars[$wpvar] ) ) 
     1664            $this->query_vars[$wpvar] = (string) $this->query_vars[$wpvar]; 
    16621665      } 
    16631666 
  • trunk/src/lyceum/wp-includes/comment-functions.php

    r1006 r1034  
    22 
    33// Template functions 
     4 
     5function 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} 
    410 
    511function comments_template( $file = '/comments.php' ) { 
     
    8591   "); 
    8692 
    87    $id = $wpdb->insert_id; 
     93   $id = (int) $wpdb->insert_id; 
    8894 
    8995   if ( $comment_approved == 1) { 
     
    234240 
    235241   if ( !$post_id ) 
    236       $post_id = $id; 
     242      $post_id = (int) $id; 
    237243 
    238244   if ( !isset($comment_count_cache[$post_id]) ) 
  • trunk/src/lyceum/wp-includes/default-filters.php

    r1005 r1034  
    3333add_filter('pre_comment_author_email', 'wp_filter_kses'); 
    3434add_filter('pre_comment_author_url', 'wp_filter_kses'); 
     35 
     36add_action('comment_form', 'wp_comment_form_unfiltered_html_nonce'); 
    3537 
    3638// Default filters for these functions 
  • trunk/src/lyceum/wp-includes/functions-formatting.php

    r1006 r1034  
    10531053   $url = str_replace($strip, '', $url); 
    10541054   $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    
    10561060   $url = preg_replace('/&([^#])(?![a-z]{2,8};)/', '&#038;$1', $url); 
    10571061   if ( !is_array($protocols) ) 
  • trunk/src/lyceum/wp-includes/functions.php

    r1018 r1034  
    172172function get_usernumposts($userid) { 
    173173   global $wpdb; 
     174   $userid = (int) $userid; 
    174175   return $wpdb->get_post_var("COUNT(DISTINCT $wpdb->posts.ID)", "post_author = '$userid' AND post_status = 'publish'"); 
    175176} 
     
    638639      $_post = & $post_cache[$post->ID]; 
    639640   } else { 
     641      $post = (int) $post; 
    640642      if ( $_post = wp_cache_get($post, 'pages') ) 
    641643         return get_page($_post, $output); 
     
    741743      $_page = $page; 
    742744   } else { 
     745      $page = (int) $page; 
    743746      if ( isset($GLOBALS['page']) && ($page == $GLOBALS['page']->ID) ) { 
    744747         $_page = & $GLOBALS['page']; 
     
    799802      $_category = $category; 
    800803   } else { 
     804      $category = (int) $category; 
    801805      if ( ! $_category = wp_cache_get($category, 'category') ) { 
    802806         $_category = $wpdb->get_row("SELECT * FROM $wpdb->categories WHERE cat_ID = '$category' LIMIT 1"); 
     
    836840      $_comment = & $comment_cache[$comment->comment_ID]; 
    837841   } else { 
     842      $comment = (int) $comment; 
    838843      if ( !isset($comment_cache[$comment]) ) { 
    839844         $_comment = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID = '$comment' LIMIT 1"); 
     
    20672072   global $wp_query; 
    20682073 
    2069    $id = $wp_query->post->ID; 
     2074   $id = (int) $wp_query->post->ID; 
    20702075   $template = get_post_meta($id, '_wp_page_template', true); 
    20712076 
     
    24422447} 
    24432448 
    2444 function wp_nonce_field($action = -1) { 
    2445    echo '<input type="hidden" name="_wpnonce" value="' . wp_create_nonce($action) . '" />'; 
    2446    wp_referer_field(); 
     2449function 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(); 
    24472454} 
    24482455 
     
    25592566      $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"; 
    25602567   } 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"; 
    25622569   } 
    25632570   $html .= "</body>\n</html>"; 
  • trunk/src/lyceum/wp-includes/functions-post.php

    r1006 r1034  
    4949   // Get the post ID. 
    5050   if ( $update ) 
    51       $post_ID = $ID; 
     51      $post_ID = (int) $ID; 
    5252 
    5353   // Create a valid post name.  Drafts are allowed to have an empty 
     
    438438 
    439439   // Set the limit clause, if we got a limit 
     440   $num = (int) $num; 
    440441   if ($num) { 
    441442      $limit = "LIMIT $num"; 
     
    507508function wp_set_post_cats($blogid = '1', $post_ID = 0, $post_categories = array()) { 
    508509   global $wpdb; 
     510    
     511   $post_ID = (int) $post_ID; 
     512 
    509513   // If $post_categories isn't already an array, make it one: 
    510514   if (!is_array($post_categories) || 0 == count($post_categories)) 
     
    517521      SELECT category_id  
    518522      FROM $wpdb->post2cat  
    519       WHERE post_id = $post_ID"); 
     523      WHERE post_id = '$post_ID'"); 
    520524    
    521525   if (!$old_categories) { 
     
    532536         $wpdb->query(" 
    533537            DELETE FROM $wpdb->post2cat  
    534             WHERE category_id = $del  
    535                AND post_id = $post_ID  
     538            WHERE category_id = '$del'  
     539               AND post_id = '$post_ID'  
    536540            "); 
    537541      } 
     
    543547   if ($add_cats) { 
    544548      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 
    551557   // Update category counts. 
    552558   $all_affected_cats = array_unique(array_merge($post_categories, $old_categories)); 
  • trunk/src/lyceum/wp-includes/links.php

    r1011 r1034  
    224224      $the_link = '#'; 
    225225      if (!empty($row->link_url)) 
    226          $the_link = attribute_escape($row->link_url); 
     226         $the_link = clean_url($row->link_url); 
    227227 
    228228      $rel = $row->link_rel; 
  • trunk/src/lyceum/wp-includes/pluggable-functions.php

    r1006 r1034  
    490490function wp_verify_nonce($nonce, $action = -1) { 
    491491   $user = wp_get_current_user(); 
    492    $uid = $user->id; 
     492   $uid = (int) $user->id; 
    493493 
    494494   $i = ceil(time() / 43200); 
     
    504504function wp_create_nonce($action = -1) { 
    505505   $user = wp_get_current_user(); 
    506    $uid = $user->id; 
     506   $uid = (int) $user->id; 
    507507 
    508508   $i = ceil(time() / 43200); 
  • trunk/src/lyceum/wp-includes/registration-functions.php

    r1003 r1034  
    9393      $query = apply_filters('update_user_query', $query); 
    9494      $wpdb->query( $query ); 
    95       $user_id = $ID; 
     95      $user_id = (int) $ID; 
    9696   } else { 
    9797      $query = "INSERT INTO $wpdb->users  
     
    101101      $query = apply_filters('create_user_query', $query); 
    102102      $wpdb->query( $query ); 
    103       $user_id = $wpdb->insert_id; 
     103      $user_id = (int) $wpdb->insert_id; 
    104104   } 
    105105    
  • trunk/src/lyceum/wp-includes/template-functions-author.php

    r1006 r1034  
    137137function get_author_link($echo = false, $author_id, $author_nicename = '') { 
    138138   global $wpdb, $wp_rewrite, $post, $cache_userdata; 
    139    $auth_ID = $author_id; 
     139   $auth_ID = (int) $author_id; 
    140140   $link = $wp_rewrite->get_author_permastruct(); 
    141141 
  • trunk/src/lyceum/wp-includes/template-functions-category.php

    r1006 r1034  
    44global $post, $category_cache; 
    55 
     6   $id = (int) $id; 
    67   if ( !$id ) 
    7       $id = $post->ID; 
     8      $id = (int) $post->ID; 
    89 
    910   if ( !isset($category_cache[$id]) ) 
  • trunk/src/lyceum/wp-includes/template-functions-general.php

    r1006 r1034  
    139139 
    140140function wp_title($sep = '&raquo;', $display = true) { 
    141    global $wpdb; 
    142    global $m, $year, $monthnum, $day, $category_name, $month, $posts; 
     141   global $wpdb, $posts, $month; 
    143142 
    144143   $cat = get_query_var('cat'); 
     
    148147   $author = get_query_var('author'); 
    149148   $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 = ''; 
    150154 
    151155   // If there's a category 
     
    153157         // category exclusion 
    154158         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) ) { 
    158161      if ( stristr($category_name,'/') ) { 
    159162            $category_name = explode('/',$category_name); 
     
    164167      } 
    165168      $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); 
    166170   } 
    167171 
     
    198202 
    199203   $prefix = ''; 
    200    if ( isset($title) ) 
     204   if ( !empty($title) ) 
    201205      $prefix = " $sep "; 
    202206 
     
    246250 
    247251function 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 
    249258   if ( !empty($monthnum) && !empty($year) ) { 
    250259      $my_year = $year; 
  • trunk/src/lyceum/wp-includes/template-functions-links.php

    r1025 r1034  
    8888   global $post, $wp_rewrite; 
    8989 
     90   $id = (int) $id; 
    9091   if ( !$id ) 
    91       $id = $post->ID; 
     92      $id = (int) $post->ID; 
    9293 
    9394   $pagestruct = $wp_rewrite->get_page_permastruct(); 
     
    110111 
    111112   if (! $id) { 
    112       $id = $post->ID; 
     113      $id = (int) $post->ID; 
    113114   } 
    114115 
     
    404405   global $wp_rewrite; 
    405406 
    406    $qstr = wp_specialchars($_SERVER['REQUEST_URI'])
     407   $qstr = $_SERVER['REQUEST_URI']
    407408 
    408409   $page_querystring = "paged";  
     
    471472} 
    472473 
    473 function next_posts($max_page = 0) { // original by cfactor at cooltux.org 
     474function get_next_posts_page_link($max_page = 0) { 
    474475   global $paged, $pagenow; 
    475476 
     
    479480      $nextpage = intval($paged) + 1; 
    480481      if ( !$max_page || $max_page >= $nextpage ) 
    481          echo get_pagenum_link($nextpage); 
    482    } 
     482         return get_pagenum_link($nextpage); 
     483   } 
     484
     485 
     486function next_posts($max_page = 0) { 
     487   echo clean_url(get_next_posts_page_link($max_page)); 
    483488} 
    484489 
     
    506511} 
    507512 
    508  
    509 function previous_posts() { // original by cfactor at cooltux.org 
     513function get_previous_posts_page_link() { 
    510514   global $paged, $pagenow; 
    511515 
     
    514518      if ( $nextpage < 1 ) 
    515519         $nextpage = 1; 
    516       echo get_pagenum_link($nextpage); 
    517    } 
    518 
    519  
     520      return get_pagenum_link($nextpage); 
     521   } 
     522
     523 
     524function previous_posts() { 
     525   echo clean_url(get_previous_posts_page_link()); 
     526
    520527 
    521528function previous_posts_link($label='&laquo; Previous Page') { 
  • trunk/src/lyceum/wp-includes/version.php

    r1014 r1034  
    33// This just holds the version number, in a separate file so we can bump it without cluttering the SVN 
    44 
    5 $wp_version = '1.0.9.0-beta'; 
     5$wp_version = '1.0.10.0-beta'; 
    66$wp_db_version = 2; 
    77 
  • trunk/src/lyceum/wp-login.php

    r1006 r1034  
    4646   $user_pass = ''; 
    4747   $using_cookie = false; 
    48    if ( !isset( $_REQUEST['redirect_to'] )
     48   if ( !isset( $_REQUEST['redirect_to'] ) || is_user_logged_in()
    4949      $redirect_to ='profile';//$redirect_to = 'wp-admin/'; 
    5050   else 
  • trunk/src/lyceum/wp-trackback.php

    r1006 r1034  
    8686   } 
    8787 
    88    $comment_post_ID = $tb_id; 
     88   $comment_post_ID = (int) $tb_id; 
    8989   $comment_author = $blog_name; 
    9090   $comment_author_email = ''; 
  • trunk/src/lyceum/xmlrpc.php

    r1016 r1034  
    210210      $this->escape($args); 
    211211 
    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]; 
    215215 
    216216     if (!$this->login_pass_ok($user_login, $user_pass)) { 
     
    245245      $this->escape($args); 
    246246 
    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]; 
    251251 
    252252     if (!$this->login_pass_ok($user_login, $user_pass)) { 
     
    293293      $this->escape($args); 
    294294 
    295      $blog_ID    = $args[1]; 
     295     $blog_ID    = (int) $args[1]; 
    296296     $user_login = $args[2]; 
    297297     $user_pass  = $args[3]; 
     
    327327      $this->escape($args); 
    328328 
    329      $blog_ID    = $args[1]; 
     329     $blog_ID    = (int) $args[1]; 
    330330     $user_login = $args[2]; 
    331331     $user_pass  = $args[3]; 
     
    364364      $this->escape($args); 
    365365 
    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 */ 
    367367     $user_login = $args[2]; 
    368368     $user_pass  = $args[3]; 
     
    411411      $this->escape($args); 
    412412 
    413      $post_ID     = $args[1]; 
     413     $post_ID     = (int) $args[1]; 
    414414     $user_login  = $args[2]; 
    415415     $user_pass   = $args[3]; 
     
    435435     extract($actual_post); 
    436436 
     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 
    437440     $post_title = xmlrpc_getposttitle($content); 
    438441     $post_category = xmlrpc_getpostcategory($content); 
     
    458461      $this->escape($args); 
    459462 
    460      $post_ID     = $args[1]; 
     463     $post_ID     = (int) $args[1]; 
    461464     $user_login  = $args[2]; 
    462465     $user_pass   = $args[3]; 
     
    499502      $this->escape($args); 
    500503 
    501      $blog_ID     = $args[0]; // we will support this in the near future 
     504     $blog_ID     = (int) $args[0]; // we will support this in the near future 
    502505     $user_login  = $args[1]; 
    503506     $user_pass   = $args[2]; 
     
    534537     } 
    535538 
    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); 
    537542 
    538543     // Do some timestamp voodoo 
     
    579584      $this->escape($args); 
    580585 
    581      $post_ID     = $args[0]; 
     586     $post_ID     = (int) $args[0]; 
    582587     $user_login  = $args[1]; 
    583588     $user_pass   = $args[2]; 
     
    613618     $post_status = $publish ? 'publish' : 'draft'; 
    614619 
     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 
    615624     if ($post_more) { 
    616625       $post_content = $post_content . "\n<!--more-->\n" . $post_more; 
    617626     } 
    618627 
    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      
    621632     $comment_status = (empty($content_struct['mt_allow_comments'])) ? 
    622633       get_settings('default_comment_status') 
     
    659670      $this->escape($args); 
    660671 
    661      $post_ID     = $args[0]; 
     672     $post_ID     = (int) $args[0]; 
    662673     $user_login  = $args[1]; 
    663674     $user_pass   = $args[2]; 
     
    714725      $this->escape($args); 
    715726 
    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]; 
    720731 
    721732     if (!$this->login_pass_ok($user_login, $user_pass)) { 
     
    781792      $this->escape($args); 
    782793 
    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]; 
    786797 
    787798     if (!$this->login_pass_ok($user_login, $user_pass)) { 
     
    815826      global $wpdb; 
    816827 
    817       $blog_ID     = $wpdb->escape($args[0])
     828      $blog_ID     = (int) $args[0]
    818829      $user_login  = $wpdb->escape($args[1]); 
    819830      $user_pass   = $wpdb->escape($args[2]); 
     
    855866      $this->escape($args); 
    856867 
    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