<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[BuddyPress] [2946] trunk: Merging 1.2 branch with trunk</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd>2946</dd>
<dt>Author</dt> <dd>apeatling</dd>
<dt>Date</dt> <dd>2010-04-21 11:34:12 +0000 (Wed, 21 Apr 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merging 1.2 branch with trunk</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpactivitybpactivityclassesphp">trunk/bp-activity/bp-activity-classes.php</a></li>
<li><a href="#trunkbpblogsphp">trunk/bp-blogs.php</a></li>
<li><a href="#trunkbpcorebpcoreadminbarphp">trunk/bp-core/bp-core-adminbar.php</a></li>
<li><a href="#trunkbpcorebpcoreavatarsphp">trunk/bp-core/bp-core-avatars.php</a></li>
<li><a href="#trunkbpcorebpcorecssjsphp">trunk/bp-core/bp-core-cssjs.php</a></li>
<li><a href="#trunkbpcorebpcoresignupphp">trunk/bp-core/bp-core-signup.php</a></li>
<li><a href="#trunkbpcorephp">trunk/bp-core.php</a></li>
<li><a href="#trunkbpforumsbpforumstemplatetagsphp">trunk/bp-forums/bp-forums-templatetags.php</a></li>
<li><a href="#trunkbpfriendsphp">trunk/bp-friends.php</a></li>
<li><a href="#trunkbpgroupsbpgroupsclassesphp">trunk/bp-groups/bp-groups-classes.php</a></li>
<li><a href="#trunkbpgroupsbpgroupstemplatetagsphp">trunk/bp-groups/bp-groups-templatetags.php</a></li>
<li><a href="#trunkbpgroupsphp">trunk/bp-groups.php</a></li>
<li><a href="#trunkbpthemesbpdefaultcommentsphp">trunk/bp-themes/bp-default/comments.php</a></li>
<li><a href="#trunkbpxprofilephp">trunk/bp-xprofile.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbpactivitybpactivityclassesphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-activity/bp-activity-classes.php (2945 => 2946)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity/bp-activity-classes.php        2010-04-21 01:57:01 UTC (rev 2945)
+++ trunk/bp-activity/bp-activity-classes.php        2010-04-21 11:34:12 UTC (rev 2946)
</span><span class="lines">@@ -34,7 +34,7 @@
</span><span class="cx">                         $this-&gt;primary_link = $row-&gt;primary_link;
</span><span class="cx">                         $this-&gt;component = $row-&gt;component;
</span><span class="cx">                         $this-&gt;type = $row-&gt;type;
</span><del>-                        $this-&gt;action = $row-&gt;type;
</del><ins>+                        $this-&gt;action = $row-&gt;action;
</ins><span class="cx">                         $this-&gt;content = $row-&gt;content;
</span><span class="cx">                         $this-&gt;date_recorded = $row-&gt;date_recorded;
</span><span class="cx">                         $this-&gt;hide_sitewide = $row-&gt;hide_sitewide;
</span><span class="lines">@@ -97,12 +97,6 @@
</span><span class="cx">                 /* Where conditions */
</span><span class="cx">                 $where_conditions = array();
</span><span class="cx"> 
</span><del>-                /* Searching */
-                if ( $search_terms ) {
-                        $search_terms = $wpdb-&gt;escape( $search_terms );
-                        $where_conditions['search_sql'] = &quot;a.content LIKE '%%&quot; . like_escape( $search_terms ) . &quot;%%'&quot;;
-                }
-
</del><span class="cx">                 /* Filtering */
</span><span class="cx">                 if ( $filter &amp;&amp; $filter_sql = BP_Activity_Activity::get_filter_sql( $filter ) )
</span><span class="cx">                         $where_conditions['filter_sql'] = $filter_sql;
</span><span class="lines">@@ -122,6 +116,18 @@
</span><span class="cx"> 
</span><span class="cx">                 $where_sql = 'WHERE ' . join( ' AND ', $where_conditions );
</span><span class="cx"> 
</span><ins>+                /* Searching */
+                if ( $search_terms ) {
+                        $search_terms = $wpdb-&gt;escape( $search_terms );
+
+                        if ( !empty( $filter['user_id'] ) )
+                                $where_sql .= ' OR ';
+                        else if ( !empty( $where_conditions ) )
+                                $where_sql .= ' AND ';
+
+                        $where_sql .= &quot;a.content LIKE '%%&quot; . like_escape( $search_terms ) . &quot;%%'&quot;;
+                }
+
</ins><span class="cx">                 if ( $per_page &amp;&amp; $page ) {
</span><span class="cx">                         $pag_sql = $wpdb-&gt;prepare( &quot;LIMIT %d, %d&quot;, intval( ( $page - 1 ) * $per_page ), intval( $per_page ) );
</span><span class="cx">                         $activities = $wpdb-&gt;get_results( $wpdb-&gt;prepare( &quot;{$select_sql} {$from_sql} {$where_sql} ORDER BY a.date_recorded {$sort} {$pag_sql}&quot; ) );
</span></span></pre></div>
<a id="trunkbpblogsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-blogs.php (2945 => 2946)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-blogs.php        2010-04-21 01:57:01 UTC (rev 2945)
+++ trunk/bp-blogs.php        2010-04-21 11:34:12 UTC (rev 2946)
</span><span class="lines">@@ -647,8 +647,9 @@
</span><span class="cx"> 
</span><span class="cx">         do_action( 'bp_blogs_remove_data', $user_id );
</span><span class="cx"> }
</span><del>-add_action( 'wpmu_delete_user', 'bp_blogs_remove_data', 1 );
-add_action( 'delete_user', 'bp_blogs_remove_data', 1 );
</del><ins>+add_action( 'wpmu_delete_user', 'bp_blogs_remove_data' );
+add_action( 'delete_user', 'bp_blogs_remove_data' );
+add_action( 'make_spam_user', 'bp_blogs_remove_data' );
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> /********************************************************************************
</span></span></pre></div>
<a id="trunkbpcorebpcoreadminbarphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-adminbar.php (2945 => 2946)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-adminbar.php        2010-04-21 01:57:01 UTC (rev 2945)
+++ trunk/bp-core/bp-core-adminbar.php        2010-04-21 11:34:12 UTC (rev 2946)
</span><span class="lines">@@ -6,7 +6,7 @@
</span><span class="cx">         if ( defined( 'BP_DISABLE_ADMIN_BAR' ) )
</span><span class="cx">                 return false;
</span><span class="cx"> 
</span><del>-        if ( (int)$bp-&gt;site_options['hide-loggedout-adminbar'] &amp;&amp; !is_user_logged_in() )
</del><ins>+        if ( (int)get_site_option( 'hide-loggedout-adminbar' ) &amp;&amp; !is_user_logged_in() )
</ins><span class="cx">                 return false;
</span><span class="cx"> 
</span><span class="cx">         $bp-&gt;doing_admin_bar = true;
</span></span></pre></div>
<a id="trunkbpcorebpcoreavatarsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-avatars.php (2945 => 2946)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-avatars.php        2010-04-21 01:57:01 UTC (rev 2945)
+++ trunk/bp-core/bp-core-avatars.php        2010-04-21 11:34:12 UTC (rev 2946)
</span><span class="lines">@@ -130,7 +130,7 @@
</span><span class="cx">                 closedir($av_dir);
</span><span class="cx"> 
</span><span class="cx">                 if ( $avatar_url )
</span><del>-                        return apply_filters( 'bp_core_fetch_avatar', &quot;&lt;img src='{$avatar_url}' alt='{$alt}' class='{$class}'{$css_id}{$html_width}{$html_height} /&gt;&quot;, $params );
</del><ins>+                        return apply_filters( 'bp_core_fetch_avatar', &quot;&lt;img src='{$avatar_url}' alt='{$alt}' class='{$class}'{$css_id}{$html_width}{$html_height} /&gt;&quot;, $params, $item_id, $avatar_dir, $css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir );
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         /* If no avatars have been uploaded for this item, display a gravatar */
</span><span class="lines">@@ -162,10 +162,9 @@
</span><span class="cx">                 $email = apply_filters( 'bp_core_gravatar_email', $email, $item_id, $object );
</span><span class="cx">                 $gravatar = apply_filters( 'bp_gravatar_url', $host ) . md5( $email ) . '?d=' . $default_grav . '&amp;amp;s=' . $grav_size;
</span><span class="cx"> 
</span><del>-                return apply_filters( 'bp_core_fetch_avatar', &quot;&lt;img src='{$gravatar}' alt='{$alt}' class='{$class}'{$css_id}{$html_width}{$html_height} /&gt;&quot;, $params );
-
</del><ins>+                return apply_filters( 'bp_core_fetch_avatar', &quot;&lt;img src='{$gravatar}' alt='{$alt}' class='{$class}'{$css_id}{$html_width}{$html_height} /&gt;&quot;, $params, $item_id, $avatar_dir, $css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir );
</ins><span class="cx">         } else {
</span><del>-                return false;
</del><ins>+                return apply_filters( 'bp_core_fetch_avatar', false, $params, $item_id, $avatar_dir, $css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir );
</ins><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -230,6 +229,13 @@
</span><span class="cx"> function bp_core_avatar_handle_upload( $file, $upload_dir_filter ) {
</span><span class="cx">         global $bp;
</span><span class="cx"> 
</span><ins>+        /***
+         * You may want to hook into this filter if you want to override this function.
+         * Make sure you return false.
+         */
+        if ( !apply_filters( 'bp_core_pre_avatar_handle_upload', true, $file, $upload_dir_filter ) )
+                return true;
+
</ins><span class="cx">         require_once( ABSPATH . '/wp-admin/includes/image.php' );
</span><span class="cx">         require_once( ABSPATH . '/wp-admin/includes/file.php' );
</span><span class="cx"> 
</span><span class="lines">@@ -303,6 +309,14 @@
</span><span class="cx">         );
</span><span class="cx"> 
</span><span class="cx">         $r = wp_parse_args( $args, $defaults );
</span><ins>+
+        /***
+         * You may want to hook into this filter if you want to override this function.
+         * Make sure you return false.
+         */
+        if ( !apply_filters( 'bp_core_pre_avatar_handle_crop', true, $r ) )
+                return true;
+
</ins><span class="cx">         extract( $r, EXTR_SKIP );
</span><span class="cx"> 
</span><span class="cx">         if ( !$original_file )
</span></span></pre></div>
<a id="trunkbpcorebpcorecssjsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-cssjs.php (2945 => 2946)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-cssjs.php        2010-04-21 01:57:01 UTC (rev 2945)
+++ trunk/bp-core/bp-core-cssjs.php        2010-04-21 11:34:12 UTC (rev 2946)
</span><span class="lines">@@ -174,7 +174,7 @@
</span><span class="cx"> function bp_core_override_adminbar_css() {
</span><span class="cx">         global $bp;
</span><span class="cx"> 
</span><del>-        if ( defined( 'BP_DISABLE_ADMIN_BAR' ) || ( $bp-&gt;site_options['hide-loggedout-adminbar'] &amp;&amp; !is_user_logged_in() ) ) {
</del><ins>+        if ( defined( 'BP_DISABLE_ADMIN_BAR' ) || ( (int)get_site_option( 'hide-loggedout-adminbar' ) &amp;&amp; !is_user_logged_in() ) ) {
</ins><span class="cx">         ?&gt;
</span><span class="cx"> &lt;style type=&quot;text/css&quot;&gt;body { padding-top: 0 !important; } #wp-admin-bar { display: none; }&lt;/style&gt;
</span><span class="cx">         &lt;?php }
</span></span></pre></div>
<a id="trunkbpcorebpcoresignupphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-signup.php (2945 => 2946)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-signup.php        2010-04-21 01:57:01 UTC (rev 2945)
+++ trunk/bp-core/bp-core-signup.php        2010-04-21 11:34:12 UTC (rev 2946)
</span><span class="lines">@@ -53,19 +53,30 @@
</span><span class="cx">                 $bp-&gt;signup-&gt;username = $_POST['signup_username'];
</span><span class="cx">                 $bp-&gt;signup-&gt;email = $_POST['signup_email'];
</span><span class="cx"> 
</span><del>-                if ( !empty( $_POST['signup_profile_field_ids'] ) &amp;&amp; function_exists( 'xprofile_check_is_required_field' ) ) {
-                        /* Now we've checked account details, we can check profile information */
-                        $profile_field_ids = explode( ',', $_POST['signup_profile_field_ids'] );
</del><ins>+                /* Now we've checked account details, we can check profile information */
+                if ( function_exists( 'xprofile_check_is_required_field' ) ) {
</ins><span class="cx"> 
</span><del>-                        /* Loop through the posted fields formatting any datebox values then validate the field */
-                        foreach ( (array) $profile_field_ids as $field_id ) {
-                                if ( !isset( $_POST['field_' . $field_id] ) ) {
-                                        if ( isset( $_POST['field_' . $field_id . '_day'] ) )
-                                                $_POST['field_' . $field_id] = strtotime( $_POST['field_' . $field_id . '_day'] . $_POST['field_' . $field_id . '_month'] . $_POST['field_' . $field_id . '_year'] );
</del><ins>+                        /* Make sure hidden field is passed and populated */
+                        if ( isset( $_POST['signup_profile_field_ids'] ) &amp;&amp; !empty( $_POST['signup_profile_field_ids'] ) ) {
+
+                                /* Let's compact any profile field info into an array */
+                                $profile_field_ids = explode( ',', $_POST['signup_profile_field_ids'] );
+
+                                /* Loop through the posted fields formatting any datebox values then validate the field */
+                                foreach ( (array) $profile_field_ids as $field_id ) {
+                                        if ( !isset( $_POST['field_' . $field_id] ) ) {
+                                                if ( isset( $_POST['field_' . $field_id . '_day'] ) )
+                                                        $_POST['field_' . $field_id] = strtotime( $_POST['field_' . $field_id . '_day'] . $_POST['field_' . $field_id . '_month'] . $_POST['field_' . $field_id . '_year'] );
+                                        }
+
+                                        /* Create errors for required fields without values */
+                                        if ( xprofile_check_is_required_field( $field_id ) &amp;&amp; empty( $_POST['field_' . $field_id] ) )
+                                                $bp-&gt;signup-&gt;errors['field_' . $field_id] = __( 'This is a required field', 'buddypress' );
</ins><span class="cx">                                 }
</span><span class="cx"> 
</span><del>-                                if ( xprofile_check_is_required_field( $field_id ) &amp;&amp; empty( $_POST['field_' . $field_id] ) )
-                                        $bp-&gt;signup-&gt;errors['field_' . $field_id] = __( 'This is a required field', 'buddypress' );
</del><ins>+                        /* This situation doesn't naturally occur so bounce to website root */
+                        } else {
+                                bp_core_redirect( $bp-&gt;root_domain );
</ins><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx"> 
</span><span class="lines">@@ -251,7 +262,7 @@
</span><span class="cx">         $user_email = sanitize_email( $user_email );
</span><span class="cx"> 
</span><span class="cx">         if ( empty( $user_name ) )
</span><del>-                   $errors-&gt;add( 'user_name', __( 'Please enter a username', 'buddypress' ) );
</del><ins>+                $errors-&gt;add( 'user_name', __( 'Please enter a username', 'buddypress' ) );
</ins><span class="cx"> 
</span><span class="cx">         $maybe = array();
</span><span class="cx">         preg_match( &quot;/[a-z0-9]+/&quot;, $user_name, $maybe );
</span><span class="lines">@@ -259,17 +270,21 @@
</span><span class="cx">         $db_illegal_names = get_site_option( 'illegal_names' );
</span><span class="cx">         $filtered_illegal_names = apply_filters( 'bp_core_illegal_usernames', array( 'www', 'web', 'root', 'admin', 'main', 'invite', 'administrator', BP_GROUPS_SLUG, $bp-&gt;members-&gt;slug, BP_FORUMS_SLUG, BP_BLOGS_SLUG, BP_REGISTER_SLUG, BP_ACTIVATION_SLUG ) );
</span><span class="cx"> 
</span><del>-        $illegal_names = array_merge( (array)$db_illegal_names, (array)$filtered_illegal_names );
</del><ins>+        /* Safely merge our illegal names into existing site_option */
+        $common_names                        = array_intersect( (array)$db_illegal_names, (array)$filtered_illegal_names );
+        $diff_names                                = array_diff( (array)$db_illegal_names, (array)$filtered_illegal_names );
+        $illegal_names                        = array_merge( (array)$diff_names, (array)$common_names );
+
</ins><span class="cx">         update_site_option( 'illegal_names', $illegal_names );
</span><span class="cx"> 
</span><span class="cx">         if ( in_array( $user_name, (array)$illegal_names ) )
</span><span class="cx">                 $errors-&gt;add( 'user_name', __( 'Sorry, that username is not allowed', 'buddypress' ) );
</span><span class="cx"> 
</span><span class="cx">         if ( !validate_username( $user_name ) || $user_name != $maybe[0] )
</span><del>-            $errors-&gt;add( 'user_name', __( 'Only lowercase letters and numbers allowed', 'buddypress' ) );
</del><ins>+                $errors-&gt;add( 'user_name', __( 'Only lowercase letters and numbers allowed', 'buddypress' ) );
</ins><span class="cx"> 
</span><span class="cx">         if( strlen( $user_name ) &lt; 4 )
</span><del>-            $errors-&gt;add( 'user_name',  __( 'Username must be at least 4 characters', 'buddypress' ) );
</del><ins>+                $errors-&gt;add( 'user_name',  __( 'Username must be at least 4 characters', 'buddypress' ) );
</ins><span class="cx"> 
</span><span class="cx">         if ( strpos( ' ' . $user_name, '_' ) != false )
</span><span class="cx">                 $errors-&gt;add( 'user_name', __( 'Sorry, usernames may not contain the character &quot;_&quot;!', 'buddypress' ) );
</span><span class="lines">@@ -384,7 +399,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function bp_core_activate_signup( $key ) {
</span><del>-        global $wpdb;
</del><ins>+        global $bp, $wpdb;
</ins><span class="cx"> 
</span><span class="cx">         $user = false;
</span><span class="cx"> 
</span><span class="lines">@@ -557,7 +572,7 @@
</span><span class="cx">                 return false;
</span><span class="cx"> 
</span><span class="cx">         if ( locate_template( array( 'registration/register.php' ), false ) || locate_template( array( 'register.php' ), false ) )
</span><del>-                wp_redirect( bp_get_root_domain() . '/' . BP_REGISTER_SLUG . '/' );
</del><ins>+                bp_core_redirect( bp_get_root_domain() . '/' . BP_REGISTER_SLUG . '/' );
</ins><span class="cx"> }
</span><span class="cx"> if ( bp_core_is_multisite() )
</span><span class="cx">         add_action( 'wp', 'bp_core_wpsignup_redirect' );
</span></span></pre></div>
<a id="trunkbpcorephp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core.php (2945 => 2946)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core.php        2010-04-21 01:57:01 UTC (rev 2945)
+++ trunk/bp-core.php        2010-04-21 11:34:12 UTC (rev 2946)
</span><span class="lines">@@ -636,7 +636,8 @@
</span><span class="cx">                 'link' =&gt; $bp-&gt;loggedin_user-&gt;domain . $slug . '/',
</span><span class="cx">                 'css_id' =&gt; $item_css_id,
</span><span class="cx">                 'show_for_displayed_user' =&gt; $show_for_displayed_user,
</span><del>-                'position' =&gt; $position
</del><ins>+                'position' =&gt; $position,
+                'screen_function' =&gt; &amp;$screen_function
</ins><span class="cx">         );
</span><span class="cx"> 
</span><span class="cx">          /***
</span><span class="lines">@@ -685,6 +686,15 @@
</span><span class="cx">         $r = wp_parse_args( $args, $defaults );
</span><span class="cx">         extract( $r, EXTR_SKIP );
</span><span class="cx"> 
</span><ins>+        if ( $function = $bp-&gt;bp_nav[$parent_slug]['screen_function'] ) {
+                if ( !is_object( $function[0] ) )
+                        remove_action( 'wp', $function, 3 );
+                else
+                        remove_action( 'wp', array( &amp;$function[0], $function[1] ), 3 );
+        }
+
+        $bp-&gt;bp_nav[$parent_slug]['screen_function'] = &amp;$screen_function;
+
</ins><span class="cx">         if ( $bp-&gt;current_component == $parent_slug &amp;&amp; !$bp-&gt;current_action ) {
</span><span class="cx">                 if ( !is_object( $screen_function[0] ) )
</span><span class="cx">                         add_action( 'wp', $screen_function, 3 );
</span><span class="lines">@@ -773,7 +783,8 @@
</span><span class="cx">                 'slug' =&gt; $slug,
</span><span class="cx">                 'css_id' =&gt; $item_css_id,
</span><span class="cx">                 'position' =&gt; $position,
</span><del>-                'user_has_access' =&gt; $user_has_access
</del><ins>+                'user_has_access' =&gt; $user_has_access,
+                'screen_function' =&gt; &amp;$screen_function
</ins><span class="cx">         );
</span><span class="cx"> 
</span><span class="cx">         if ( ( $bp-&gt;current_action == $slug &amp;&amp; $bp-&gt;current_component == $parent_slug ) &amp;&amp; $user_has_access ) {
</span><span class="lines">@@ -833,6 +844,13 @@
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx"> 
</span><ins>+        if ( $function = $bp-&gt;bp_nav[$parent_id]['screen_function'] ) {
+                if ( !is_object( $function[0] ) )
+                        remove_action( 'wp', $function, 3 );
+                else
+                        remove_action( 'wp', array( &amp;$function[0], $function[1] ), 3 );
+        }
+
</ins><span class="cx">         unset( $bp-&gt;bp_nav[$parent_id] );
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -848,13 +866,11 @@
</span><span class="cx"> function bp_core_remove_subnav_item( $parent_id, $slug ) {
</span><span class="cx">         global $bp;
</span><span class="cx"> 
</span><del>-        $function = $bp-&gt;bp_options_nav[$parent_id][$slug]['screen_function'];
-
-        if ( $function ) {
-                if ( !is_object( $screen_function[0] ) )
-                        remove_action( 'wp', $screen_function, 3 );
</del><ins>+        if ( $function = $bp-&gt;bp_options_nav[$parent_id][$slug]['screen_function'] ) {
+                if ( !is_object( $function[0] ) )
+                        remove_action( 'wp', $function, 3 );
</ins><span class="cx">                 else
</span><del>-                        remove_action( 'wp', array( &amp;$screen_function[0], $screen_function[1] ), 3 );
</del><ins>+                        remove_action( 'wp', array( &amp;$function[0], $function[1] ), 3 );
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         unset( $bp-&gt;bp_options_nav[$parent_id][$slug] );
</span><span class="lines">@@ -1841,9 +1857,9 @@
</span><span class="cx">         /* Flush the cache to remove the user from all cached objects */
</span><span class="cx">         wp_cache_flush();
</span><span class="cx"> }
</span><del>-add_action( 'wpmu_delete_user', 'bp_core_remove_data', 1 );
-add_action( 'delete_user', 'bp_core_remove_data', 1 );
-add_action( 'make_spam_user', 'bp_core_remove_data', 1 );
</del><ins>+add_action( 'wpmu_delete_user', 'bp_core_remove_data' );
+add_action( 'delete_user', 'bp_core_remove_data' );
+add_action( 'make_spam_user', 'bp_core_remove_data' );
</ins><span class="cx"> 
</span><span class="cx"> /**
</span><span class="cx">  * bp_load_buddypress_textdomain()
</span></span></pre></div>
<a id="trunkbpforumsbpforumstemplatetagsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-forums/bp-forums-templatetags.php (2945 => 2946)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-forums/bp-forums-templatetags.php        2010-04-21 01:57:01 UTC (rev 2945)
+++ trunk/bp-forums/bp-forums-templatetags.php        2010-04-21 11:34:12 UTC (rev 2946)
</span><span class="lines">@@ -253,7 +253,7 @@
</span><span class="cx">                 global $forum_template;
</span><span class="cx"> 
</span><span class="cx">                 $post = bb_get_first_post( (int)$forum_template-&gt;topic-&gt;topic_id, false );
</span><del>-                return apply_filters( 'bp_get_the_topic_text', $post-&gt;post_text );
</del><ins>+                return apply_filters( 'bp_get_the_topic_text', attribute_escape( $post-&gt;post_text ) );
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx"> function bp_the_topic_poster_id() {
</span><span class="lines">@@ -463,7 +463,7 @@
</span><span class="cx">         function bp_get_the_topic_total_posts() {
</span><span class="cx">                 global $forum_template;
</span><span class="cx"> 
</span><del>-                return $forum_template-&gt;topic-&gt;topic_posts;
</del><ins>+                return apply_filters( 'bp_get_the_topic_total_posts', $forum_template-&gt;topic-&gt;topic_posts );
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx"> function bp_the_topic_tag_count() {
</span><span class="lines">@@ -937,7 +937,7 @@
</span><span class="cx">                 global $bp;
</span><span class="cx"> 
</span><span class="cx">                 $post = bp_forums_get_post( $bp-&gt;action_variables[4] );
</span><del>-                return attribute_escape( $post-&gt;post_text );
</del><ins>+                return apply_filters( 'bp_get_the_topic_post_edit_text', attribute_escape( $post-&gt;post_text ) );
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx"> function bp_the_topic_pagination() {
</span></span></pre></div>
<a id="trunkbpfriendsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-friends.php (2945 => 2946)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-friends.php        2010-04-21 01:57:01 UTC (rev 2945)
+++ trunk/bp-friends.php        2010-04-21 11:34:12 UTC (rev 2946)
</span><span class="lines">@@ -565,9 +565,9 @@
</span><span class="cx"> 
</span><span class="cx">         do_action( 'friends_remove_data', $user_id );
</span><span class="cx"> }
</span><del>-add_action( 'wpmu_delete_user', 'friends_remove_data', 1 );
-add_action( 'delete_user', 'friends_remove_data', 1 );
-add_action( 'make_spam_user', 'friends_remove_data', 1 );
</del><ins>+add_action( 'wpmu_delete_user', 'friends_remove_data' );
+add_action( 'delete_user', 'friends_remove_data' );
+add_action( 'make_spam_user', 'friends_remove_data' );
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> /********************************************************************************
</span></span></pre></div>
<a id="trunkbpgroupsbpgroupsclassesphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-groups/bp-groups-classes.php (2945 => 2946)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-groups/bp-groups-classes.php        2010-04-21 01:57:01 UTC (rev 2945)
+++ trunk/bp-groups/bp-groups-classes.php        2010-04-21 11:34:12 UTC (rev 2946)
</span><span class="lines">@@ -128,7 +128,7 @@
</span><span class="cx">                 $user_ids = implode( ',', (array)$user_ids );
</span><span class="cx"> 
</span><span class="cx">                 /* Modify group count usermeta for members */
</span><del>-                $wpdb-&gt;query( $wpdb-&gt;prepare( &quot;UPDATE {$bp-&gt;groups-&gt;table_name_groupmeta} SET meta_value = meta_value - 1 WHERE meta_key = 'total_group_count' AND user_id IN ( {$user_ids} )&quot; ) );
</del><ins>+                $wpdb-&gt;query( $wpdb-&gt;prepare( &quot;UPDATE {$wpdb-&gt;usermeta} SET meta_value = meta_value - 1 WHERE meta_key = 'total_group_count' AND user_id IN ( {$user_ids} )&quot; ) );
</ins><span class="cx"> 
</span><span class="cx">                 /* Now delete all group member entries */
</span><span class="cx">                 BP_Groups_Member::delete_all( $this-&gt;id );
</span></span></pre></div>
<a id="trunkbpgroupsbpgroupstemplatetagsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-groups/bp-groups-templatetags.php (2945 => 2946)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-groups/bp-groups-templatetags.php        2010-04-21 01:57:01 UTC (rev 2945)
+++ trunk/bp-groups/bp-groups-templatetags.php        2010-04-21 11:34:12 UTC (rev 2946)
</span><span class="lines">@@ -64,7 +64,7 @@
</span><span class="cx">                 }
</span><span class="cx"> 
</span><span class="cx">                 $this-&gt;pag_links = paginate_links( array(
</span><del>-                        'base' =&gt; add_query_arg( array( 'grpage' =&gt; '%#%', 'num' =&gt; $this-&gt;pag_num, 's' =&gt; $_REQUEST['s'], 'sortby' =&gt; $this-&gt;sort_by, 'order' =&gt; $this-&gt;order ) ),
</del><ins>+                        'base' =&gt; add_query_arg( array( 'grpage' =&gt; '%#%', 'num' =&gt; $this-&gt;pag_num, 's' =&gt; $search_terms, 'sortby' =&gt; $this-&gt;sort_by, 'order' =&gt; $this-&gt;order ) ),
</ins><span class="cx">                         'format' =&gt; '',
</span><span class="cx">                         'total' =&gt; ceil($this-&gt;total_group_count / $this-&gt;pag_num),
</span><span class="cx">                         'current' =&gt; $this-&gt;pag_page,
</span></span></pre></div>
<a id="trunkbpgroupsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-groups.php (2945 => 2946)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-groups.php        2010-04-21 01:57:01 UTC (rev 2945)
+++ trunk/bp-groups.php        2010-04-21 11:34:12 UTC (rev 2946)
</span><span class="lines">@@ -2416,9 +2416,9 @@
</span><span class="cx"> 
</span><span class="cx">         do_action( 'groups_remove_data_for_user', $user_id );
</span><span class="cx"> }
</span><del>-add_action( 'wpmu_delete_user', 'groups_remove_data_for_user', 1 );
-add_action( 'delete_user', 'groups_remove_data_for_user', 1 );
-add_action( 'make_spam_user', 'groups_remove_data_for_user', 1 );
</del><ins>+add_action( 'wpmu_delete_user', 'groups_remove_data_for_user' );
+add_action( 'delete_user', 'groups_remove_data_for_user' );
+add_action( 'make_spam_user', 'groups_remove_data_for_user' );
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> /********************************************************************************
</span></span></pre></div>
<a id="trunkbpthemesbpdefaultcommentsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/comments.php (2945 => 2946)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/comments.php        2010-04-21 01:57:01 UTC (rev 2945)
+++ trunk/bp-themes/bp-default/comments.php        2010-04-21 11:34:12 UTC (rev 2946)
</span><span class="lines">@@ -19,7 +19,7 @@
</span><span class="cx">                         ?&gt;
</span><span class="cx"> 
</span><span class="cx">                         &lt;span class=&quot;title&quot;&gt;&lt;?php the_title() ?&gt;&lt;/span&gt;
</span><del>-                        &lt;h3 id=&quot;comments&quot;&gt;&lt;?php comments_number( 'No Comments', 'One Comment', $numComments . ' Comments' );?&gt;&lt;/h3&gt;
</del><ins>+                        &lt;h3 id=&quot;comments&quot;&gt;&lt;?php comments_number( '', '', $numComments );?&gt;&lt;/h3&gt;
</ins><span class="cx"> 
</span><span class="cx">                         &lt;?php do_action( 'bp_before_blog_comment_list' ) ?&gt;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkbpxprofilephp"></a>
<div class="modfile"><h4>Modified: trunk/bp-xprofile.php (2945 => 2946)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-xprofile.php        2010-04-21 01:57:01 UTC (rev 2945)
+++ trunk/bp-xprofile.php        2010-04-21 11:34:12 UTC (rev 2946)
</span><span class="lines">@@ -891,8 +891,9 @@
</span><span class="cx">         delete_usermeta( $user_id, 'bp_core_avatar_v2' );
</span><span class="cx">         delete_usermeta( $user_id, 'bp_core_avatar_v2_path' );
</span><span class="cx"> }
</span><del>-add_action( 'wpmu_delete_user', 'xprofile_remove_data', 1 );
-add_action( 'delete_user', 'xprofile_remove_data', 1 );
</del><ins>+add_action( 'wpmu_delete_user', 'xprofile_remove_data' );
+add_action( 'delete_user', 'xprofile_remove_data' );
+add_action( 'make_spam_user', 'xprofile_remove_data' );
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> /********************************************************************************
</span></span></pre>
</div>
</div>

</body>
</html>