<!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] [1779] trunk: Updated code with wp_get_referer()</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd>1779</dd>
<dt>Author</dt> <dd>apeatling</dd>
<dt>Date</dt> <dd>2009-09-03 18:59:40 +0000 (Thu, 03 Sep 2009)</dd>
</dl>

<h3>Log Message</h3>
<pre>Updated code with wp_get_referer()</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpactivitybpactivityclassesphp">trunk/bp-activity/bp-activity-classes.php</a></li>
<li><a href="#trunkbpactivitybpactivityfiltersphp">trunk/bp-activity/bp-activity-filters.php</a></li>
<li><a href="#trunkbpfriendsphp">trunk/bp-friends.php</a></li>
<li><a href="#trunkbpgroupsphp">trunk/bp-groups.php</a></li>
<li><a href="#trunkbpwirebpwirefiltersphp">trunk/bp-wire/bp-wire-filters.php</a></li>
<li><a href="#trunkbpwirephp">trunk/bp-wire.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 (1778 => 1779)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity/bp-activity-classes.php        2009-09-03 18:29:12 UTC (rev 1778)
+++ trunk/bp-activity/bp-activity-classes.php        2009-09-03 18:59:40 UTC (rev 1779)
</span><span class="lines">@@ -84,6 +84,9 @@
</span><span class="cx">         function exists() {
</span><span class="cx">                 global $wpdb, $bp;
</span><span class="cx">                 
</span><ins>+                /* This doesn't seem to be working correctly at the moment, so it is disabled [TODO] */
+                return false;
+                
</ins><span class="cx">                 /* If we have an item id, try and match on that, if not do a content match */
</span><span class="cx">                 if ( $this-&gt;item_id ) {
</span><span class="cx">                         if ( $this-&gt;secondary_item_id )
</span></span></pre></div>
<a id="trunkbpactivitybpactivityfiltersphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-activity/bp-activity-filters.php (1778 => 1779)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity/bp-activity-filters.php        2009-09-03 18:29:12 UTC (rev 1778)
+++ trunk/bp-activity/bp-activity-filters.php        2009-09-03 18:59:40 UTC (rev 1779)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> &lt;?php
</span><span class="cx"> 
</span><span class="cx"> /* Apply WordPress defined filters */
</span><del>-add_filter( 'bp_get_activity_content', 'wp_filter_kses', 1 );
</del><ins>+add_filter( 'bp_get_activity_content', 'wp_filter_kse', 1 );
</ins><span class="cx"> add_filter( 'bp_get_activity_content', 'force_balance_tags' );
</span><span class="cx"> add_filter( 'bp_get_activity_content', 'wptexturize' );
</span><span class="cx"> add_filter( 'bp_get_activity_content', 'convert_smilies' );
</span><span class="lines">@@ -15,6 +15,11 @@
</span><span class="cx">         $allowedtags['span']['class'] = array();
</span><span class="cx">         $allowedtags['a']['class'] = array();
</span><span class="cx">         $allowedtags['img'] = array();
</span><ins>+        $allowedtags['img']['src'] = array();
+        $allowedtags['img']['alt'] = array();
+        $allowedtags['img']['class'] = array();
+        $allowedtags['img']['id'] = array();
+        
</ins><span class="cx">         return $allowedtags;
</span><span class="cx"> }
</span><span class="cx"> add_filter( 'edit_allowedtags', 'bp_activity_add_allowed_tags', 1 );
</span></span></pre></div>
<a id="trunkbpfriendsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-friends.php (1778 => 1779)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-friends.php        2009-09-03 18:29:12 UTC (rev 1778)
+++ trunk/bp-friends.php        2009-09-03 18:59:40 UTC (rev 1779)
</span><span class="lines">@@ -218,7 +218,7 @@
</span><span class="cx">                 bp_core_add_message( __( 'You already have a pending friendship request with this user', 'buddypress' ), 'error' );                
</span><span class="cx">         }
</span><span class="cx">         
</span><del>-        bp_core_redirect( $_SERVER['HTTP_REFERER'] );
</del><ins>+        bp_core_redirect( wp_get_referer() );
</ins><span class="cx">         
</span><span class="cx">         return false;
</span><span class="cx"> }
</span><span class="lines">@@ -256,7 +256,7 @@
</span><span class="cx">                 bp_core_add_message( __( 'You have a pending friendship request with this user', 'buddypress' ), 'error' );                
</span><span class="cx">         }
</span><span class="cx">         
</span><del>-        bp_core_redirect( $_SERVER['HTTP_REFERER'] );
</del><ins>+        bp_core_redirect( wp_get_referer() );
</ins><span class="cx">         
</span><span class="cx">         return false;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkbpgroupsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-groups.php (1778 => 1779)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-groups.php        2009-09-03 18:29:12 UTC (rev 1778)
+++ trunk/bp-groups.php        2009-09-03 18:59:40 UTC (rev 1779)
</span><span class="lines">@@ -777,7 +777,7 @@
</span><span class="cx">                         else
</span><span class="cx">                                 bp_core_add_message( __('Wire message successfully posted.', 'buddypress') );
</span><span class="cx"> 
</span><del>-                        if ( !strpos( $_SERVER['HTTP_REFERER'], $bp-&gt;wire-&gt;slug ) )
</del><ins>+                        if ( !strpos( wp_get_referer(), $bp-&gt;wire-&gt;slug ) )
</ins><span class="cx">                                 bp_core_redirect( bp_get_group_permalink( $bp-&gt;groups-&gt;current_group ) );
</span><span class="cx">                         else
</span><span class="cx">                                 bp_core_redirect( bp_get_group_permalink( $bp-&gt;groups-&gt;current_group ) . '/' . $bp-&gt;wire-&gt;slug );
</span><span class="lines">@@ -794,7 +794,7 @@
</span><span class="cx">                         else
</span><span class="cx">                                 bp_core_add_message( __('Wire message successfully deleted.', 'buddypress') );
</span><span class="cx">                         
</span><del>-                        if ( !strpos( $_SERVER['HTTP_REFERER'], $bp-&gt;wire-&gt;slug ) )
</del><ins>+                        if ( !strpos( wp_get_referer(), $bp-&gt;wire-&gt;slug ) )
</ins><span class="cx">                                 bp_core_redirect( bp_get_group_permalink( $bp-&gt;groups-&gt;current_group ) );
</span><span class="cx">                         else
</span><span class="cx">                                 bp_core_redirect( bp_get_group_permalink( $bp-&gt;groups-&gt;current_group ) . '/' . $bp-&gt;wire-&gt;slug );
</span></span></pre></div>
<a id="trunkbpwirebpwirefiltersphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-wire/bp-wire-filters.php (1778 => 1779)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-wire/bp-wire-filters.php        2009-09-03 18:29:12 UTC (rev 1778)
+++ trunk/bp-wire/bp-wire-filters.php        2009-09-03 18:59:40 UTC (rev 1779)
</span><span class="lines">@@ -1,7 +1,9 @@
</span><span class="cx"> &lt;?php
</span><span class="cx"> 
</span><span class="cx"> /* Apply WordPress defined filters */
</span><ins>+add_filter( 'bp_wire_post_content_before_save', 'wp_filter_kses', 1 );
</ins><span class="cx"> add_filter( 'bp_get_wire_post_content', 'wp_filter_kses', 1 );
</span><ins>+
</ins><span class="cx"> add_filter( 'bp_get_wire_post_content', 'wptexturize' );
</span><span class="cx"> add_filter( 'bp_get_wire_post_content', 'convert_smilies', 2 );
</span><span class="cx"> add_filter( 'bp_get_wire_post_content', 'convert_chars' );
</span><span class="lines">@@ -9,7 +11,15 @@
</span><span class="cx"> add_filter( 'bp_get_wire_post_content', 'stripslashes_deep' );
</span><span class="cx"> add_filter( 'bp_get_wire_post_content', 'make_clickable' );
</span><span class="cx"> 
</span><del>-add_filter( 'bp_wire_post_content_before_save', 'wp_filter_kses', 1 );
</del><span class="cx"> add_filter( 'bp_wire_post_content_before_save', 'force_balance_tags' );
</span><span class="cx"> 
</span><ins>+function bp_wire_add_allowed_tags( $allowedtags ) {
+        $allowedtags['strong'] = array();
+        $allowedtags['em'] = array();
+        $allowedtags['img'] = array();
+        return $allowedtags;
+}
+add_filter( 'edit_allowedtags', 'bp_wire_add_allowed_tags', 1 );
+
+
</ins><span class="cx"> ?&gt;
</span><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkbpwirephp"></a>
<div class="modfile"><h4>Modified: trunk/bp-wire.php (1778 => 1779)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-wire.php        2009-09-03 18:29:12 UTC (rev 1778)
+++ trunk/bp-wire.php        2009-09-03 18:59:40 UTC (rev 1779)
</span><span class="lines">@@ -92,10 +92,7 @@
</span><span class="cx">         $wire_post-&gt;item_id = $item_id;
</span><span class="cx">         $wire_post-&gt;user_id = $bp-&gt;loggedin_user-&gt;id;
</span><span class="cx">         $wire_post-&gt;date_posted = time();
</span><del>-
-        $allowed_tags = apply_filters( 'bp_wire_post_allowed_tags', '&lt;a&gt;&lt;b&gt;&lt;strong&gt;&lt;i&gt;&lt;em&gt;&lt;img&gt;' );
-                
-        $wire_post-&gt;content = apply_filters( 'bp_wire_post_content', $message );
</del><ins>+        $wire_post-&gt;content = $message;
</ins><span class="cx">         
</span><span class="cx">         if ( !$wire_post-&gt;save() )
</span><span class="cx">                 return false;
</span></span></pre></div>
<a id="trunkbpxprofilephp"></a>
<div class="modfile"><h4>Modified: trunk/bp-xprofile.php (1778 => 1779)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-xprofile.php        2009-09-03 18:29:12 UTC (rev 1778)
+++ trunk/bp-xprofile.php        2009-09-03 18:59:40 UTC (rev 1779)
</span><span class="lines">@@ -458,7 +458,7 @@
</span><span class="cx">         else
</span><span class="cx">                 bp_core_add_message( __( 'There was a problem deleting that avatar, please try again.', 'buddypress' ), 'error' );
</span><span class="cx"> 
</span><del>-        bp_core_redirect( $_SERVER['HTTP_REFERER'] ); 
</del><ins>+        bp_core_redirect( wp_get_referer() ); 
</ins><span class="cx"> }
</span><span class="cx"> add_action( 'wp', 'xprofile_action_delete_avatar', 3 );
</span><span class="cx"> 
</span><span class="lines">@@ -521,7 +521,7 @@
</span><span class="cx">                 do_action( 'xprofile_new_wire_post', &amp;$wire_post );        
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if ( !strpos( $_SERVER['HTTP_REFERER'], $bp-&gt;wire-&gt;slug ) ) {
</del><ins>+        if ( !strpos( wp_get_referer(), $bp-&gt;wire-&gt;slug ) ) {
</ins><span class="cx">                 bp_core_redirect( $bp-&gt;displayed_user-&gt;domain );
</span><span class="cx">         } else {
</span><span class="cx">                 bp_core_redirect( $bp-&gt;displayed_user-&gt;domain . $bp-&gt;wire-&gt;slug );
</span><span class="lines">@@ -563,7 +563,7 @@
</span><span class="cx">                 bp_core_add_message( __('Wire post could not be deleted, please try again.', 'buddypress'), 'error' );
</span><span class="cx">         }
</span><span class="cx">         
</span><del>-        if ( !strpos( $_SERVER['HTTP_REFERER'], $bp-&gt;wire-&gt;slug ) ) {
</del><ins>+        if ( !strpos( wp_get_referer(), $bp-&gt;wire-&gt;slug ) ) {
</ins><span class="cx">                 bp_core_redirect( $bp-&gt;displayed_user-&gt;domain );
</span><span class="cx">         } else {
</span><span class="cx">                 bp_core_redirect( $bp-&gt;displayed_user-&gt;domain. $bp-&gt;wire-&gt;slug );
</span></span></pre>
</div>
</div>

</body>
</html>