<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Dan Polant :: Web Interaction Designer &#187; email address</title>
	<atom:link href="http://danpolant.com/tag/email-address/feed/" rel="self" type="application/rss+xml" />
	<link>http://danpolant.com</link>
	<description></description>
	<lastBuildDate>Tue, 01 Nov 2011 03:55:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>How to: use email addresses as usernames in Buddypress</title>
		<link>http://danpolant.com/how-to-use-email-addresses-as-usernames-in-buddypress/</link>
		<comments>http://danpolant.com/how-to-use-email-addresses-as-usernames-in-buddypress/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 01:13:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[buddypress]]></category>
		<category><![CDATA[email address]]></category>

		<guid isPermaLink="false">http://danpolant.com/?p=202</guid>
		<description><![CDATA[Just spent about 5 hours on this one, enjoy &#8230;
I&#8217;ve seen this question come up on a lot of forums &#8211; people want to use email addresses as usernames in Buddypress. It makes sense &#8211; emails are easy to remember. But Buddypress has made this difficult to do. Andy Peatling added the following constant to [...]]]></description>
			<content:encoded><![CDATA[<p>Just spent about 5 hours on this one, enjoy &#8230;</p>
<p>I&#8217;ve seen this question come up on a lot of forums &#8211; people want to use email addresses as usernames in Buddypress. It makes sense &#8211; emails are easy to remember. But Buddypress has made this difficult to do. Andy Peatling added the following constant to the core:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><a href="http://www.php.net/define"><span class="kw3">define</span></a><span class="br0">&#40;</span> <span class="st0">&#8216;BP_ENABLE_USERNAME_COMPATIBILITY_MODE&#8217;</span>, <span class="kw2">true</span> <span class="br0">&#41;</span>;</div>
</li>
</ol>
</div>
<p>in order to deal with part of this problem. But this did not solve the problem completely. See <a href="http://codex.buddypress.org/how-to-guides/changing-internal-configuration-settings/">this article</a> for how to use this. This changed allowed users to navigate to an @-containing username&#8217;s profile, but that user could not do things like create groups or edit his profile.</p>
<p>It turns out there&#8217;s another step to getting this to work. You have to override <code>wp_sanitize_redirect</code> in wp-includes/pluggable.php and add &#8216;@&#8217; to the list of OK characters, like this:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw2">function</span> wp_sanitize_redirect<span class="br0">&#40;</span><span class="re0">$location</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$location</span> = <a href="http://www.php.net/preg_replace"><span class="kw3">preg_replace</span></a><span class="br0">&#40;</span><span class="st0">&#8216;|[^a-z0-9-~+_.?#=&amp;;,/:%!@]|i&#8217;</span>, <span class="st0">&#8221;</span>, <span class="re0">$location</span><span class="br0">&#41;</span>; <span class="co1">//this line needs to have an @</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$location</span> = wp_kses_no_null<span class="br0">&#40;</span><span class="re0">$location</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// remove %0d and %0a from location</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$strip</span> = <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="st0">&#8216;%0d&#8217;</span>, <span class="st0">&#8216;%0a&#8217;</span>, <span class="st0">&#8216;%0D&#8217;</span>, <span class="st0">&#8216;%0A&#8217;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$location</span> = _deep_replace<span class="br0">&#40;</span><span class="re0">$strip</span>, <span class="re0">$location</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="re0">$location</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
<p>Now it should work. </p>
]]></content:encoded>
			<wfw:commentRss>http://danpolant.com/how-to-use-email-addresses-as-usernames-in-buddypress/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

