<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel>
        <title>Module: Facebook URL Fixer</title>
        <description> Facebook has a silly bug which messes up Phorum URLs.  In a nutshell, Facebook has to encode URLs submitted to their Graph, but when it comes time to decode that URL back into its working form, they forget to decode commas, leaving %2C in places that Phorum expects to see commas. Here is some chatter about this: [www.phorum.org]

Probably Facebook will fix their bug.  In the meantime, why wait?  Here is a simple module that works around it, based on Maurice&amp;#039;s idea in the above thread, and the very fortunate foresight of the Phorum team to  place a parse_request hook just before query strings are parsed.

Enjoy,

-phil.

Change log:
August 3, 2011 - skip decoding when Phorum&amp;#039;s redirect.php is the executing script</description>
        <link>https://www.phorum.org/support/read.php?62,146932,146932#msg-146932</link>
        <lastBuildDate>Tue, 13 Oct 2026 04:32:48 -0500</lastBuildDate>
        <generator>Phorum 6.0.4</generator>
        <item>
            <guid>https://www.phorum.org/support/read.php?62,146932,151125#msg-151125</guid>
            <title>Re: Module: Facebook URL Fixer</title>
            <link>https://www.phorum.org/support/read.php?62,146932,151125#msg-151125</link>
            <description><![CDATA[ Whoops, the code above has a bug (overwrites PHORUM_CUSTOM_QUERY_STRING in the 2c case).<br />
Should just use the case insensitive versions like so:<br />
<br />
[code=&quot;php&quot;]<br />
<br />
  if(strtolower($self[count($self)-1]) !== &#039;redirect.php&#039; &amp;&amp; stripos($_SERVER[&#039;QUERY_STRING&#039;], &#039;%2C&#039;) !== false) {<br />
    // Override the query string.<br />
    global $PHORUM_CUSTOM_QUERY_STRING;<br />
    $PHORUM_CUSTOM_QUERY_STRING = str_ireplace(&#039;%2C&#039;,&#039;,&#039;,$_SERVER[&#039;QUERY_STRING&#039;]); # Facebook cap, Hotmail lower<br />
    $PHORUM_CUSTOM_QUERY_STRING = str_ireplace(&#039;%3D&#039;,&#039;=&#039;,$PHORUM_CUSTOM_QUERY_STRING);<br />
  }<br />
[/code]]]></description>
            <dc:creator>Skye N.</dc:creator>
            <category>v5/v6 Modules/Add-Ons</category>
            <pubDate>Sat, 31 Mar 2012 14:40:31 -0500</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?62,146932,150934#msg-150934</guid>
            <title>Re: Module: Facebook URL Fixer</title>
            <link>https://www.phorum.org/support/read.php?62,146932,150934#msg-150934</link>
            <description><![CDATA[ Just a quick note.  Hotmail has the same problem, except (guess what) it uses lowercase %2c instead of %2C like Facebook does. <br />
Anyway, easy to patch your code to handle that too, just add a replacement and chage strpos to stripos<br />
<br />
[code=&quot;php&quot;]<br />
  if(strtolower($self[count($self)-1]) !== &#039;redirect.php&#039; &amp;&amp; stripos($_SERVER[&#039;QUERY_STRING&#039;], &#039;%2C&#039;) !== false) {<br />
    // Override the query string.<br />
    global $PHORUM_CUSTOM_QUERY_STRING;<br />
    $PHORUM_CUSTOM_QUERY_STRING = str_replace(&#039;%2C&#039;,&#039;,&#039;,$_SERVER[&#039;QUERY_STRING&#039;]); # Facebook<br />
    $PHORUM_CUSTOM_QUERY_STRING = str_replace(&#039;%2c&#039;,&#039;,&#039;,$_SERVER[&#039;QUERY_STRING&#039;]); # Hotmail<br />
    $PHORUM_CUSTOM_QUERY_STRING = str_replace(&#039;%3D&#039;,&#039;=&#039;,$PHORUM_CUSTOM_QUERY_STRING);<br />
  }<br />
[/code]]]></description>
            <dc:creator>Skye N.</dc:creator>
            <category>v5/v6 Modules/Add-Ons</category>
            <pubDate>Wed, 08 Feb 2012 18:52:38 -0600</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?62,146932,150703#msg-150703</guid>
            <title>Re: Module: Facebook URL Fixer</title>
            <link>https://www.phorum.org/support/read.php?62,146932,150703#msg-150703</link>
            <description><![CDATA[ Thanks Phil.  This bug has been open on Facebook for over a year now, so I&#039;m not holding my breath....<br />
<br />
[<a href="http://bugs.developers.facebook.net/show_bug.cgi?id=13655" target="_blank"  rel="nofollow">bugs.developers.facebook.net</a>]]]></description>
            <dc:creator>Skye N.</dc:creator>
            <category>v5/v6 Modules/Add-Ons</category>
            <pubDate>Thu, 22 Dec 2011 14:52:19 -0600</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?62,146932,149331#msg-149331</guid>
            <title>Re: Module: Facebook URL Fixer</title>
            <link>https://www.phorum.org/support/read.php?62,146932,149331#msg-149331</link>
            <description><![CDATA[ Update release today: fixed the problem where the module was decoding URLs that are wrapped by Phorum&#039;s redirect.php script.  Thanks to Robert Angle for discovering this one.]]></description>
            <dc:creator>Phil Connolly</dc:creator>
            <category>v5/v6 Modules/Add-Ons</category>
            <pubDate>Wed, 03 Aug 2011 13:24:16 -0500</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?62,146932,149325#msg-149325</guid>
            <title>Re: Module: Facebook URL Fixer</title>
            <link>https://www.phorum.org/support/read.php?62,146932,149325#msg-149325</link>
            <description><![CDATA[ Wierd...  so I traced through Phorum code, and also hooked up fiddler and watched what was happening between my browser and the server. <br />
<br />
When redirect_after_post = &#039;read&#039;, I can see Phorum is trying to do what you want, jump to the last message of the thread, and its full URL contains an anchor (#).  Phorum has some twiddling it does in the case it must redirect to an anchor from a POSTed page (such as replying to a post), mainly to overcome an Internet Explorer bug which strips the anchor, and in this case Phorum wraps the redirect in a special case script (no surprise, it is named redirect.php) which sends the browser to the correct URL, including the anchor.  The destination URL is first encoded by Phorum and then decoded by redirect.php, but my little module didn&#039;t know all that so goes ahead and decodes the URL itself, thereby messing up redirect.php, and leaving Phorum with a bogus URL which it defaults to the forum list page.<br />
<br />
I wrote that summary not expecting you would care one way or the other of the technical issue, may be you do, but mainly so any Phorum experts can provide a tip to workaround this.  My initial thought is to just test if redirect.php is the page being accessed and if so skip the facebook-fixing decoding.  That would be easy, but maybe there are other cases similar to this I should be aware of?<br />
<br />
I&#039;ll make a change based on what I know tomorrow.<br />
<br />
-phil.]]></description>
            <dc:creator>Phil Connolly</dc:creator>
            <category>v5/v6 Modules/Add-Ons</category>
            <pubDate>Wed, 03 Aug 2011 00:26:23 -0500</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?62,146932,149324#msg-149324</guid>
            <title>Re: Module: Facebook URL Fixer</title>
            <link>https://www.phorum.org/support/read.php?62,146932,149324#msg-149324</link>
            <description><![CDATA[ I just wanna report an issue.<br />
<br />
In our General Forum Settings, we can specify whether after submitting a post, the user is redirected to the list page or the newly posted message itself on the read page. I personally have selected the latter, so users see their post after submitting it.<br />
<br />
When this module is activated, new topic will redirect to the message as it should, but all replies to topics get redirected to the list page. In other words, the setting to redirect to the read page instead of the list page seems to be ignore when replying to posts and having this module activated.]]></description>
            <dc:creator>Robert Angle</dc:creator>
            <category>v5/v6 Modules/Add-Ons</category>
            <pubDate>Tue, 02 Aug 2011 22:10:50 -0500</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?62,146932,146932#msg-146932</guid>
            <title>Module: Facebook URL Fixer</title>
            <link>https://www.phorum.org/support/read.php?62,146932,146932#msg-146932</link>
            <description><![CDATA[ Facebook has a silly bug which messes up Phorum URLs.  In a nutshell, Facebook has to encode URLs submitted to their Graph, but when it comes time to decode that URL back into its working form, they forget to decode commas, leaving %2C in places that Phorum expects to see commas. Here is some chatter about this: [<a href="http://www.phorum.org/phorum5/read.php?61,145041,145041" target="_blank" >www.phorum.org</a>]<br />
<br />
Probably Facebook will fix their bug.  In the meantime, why wait?  Here is a simple module that works around it, based on Maurice&#039;s idea in the above thread, and the very fortunate foresight of the Phorum team to  place a parse_request hook just before query strings are parsed.<br />
<br />
Enjoy,<br />
<br />
-phil.<br />
<br />
Change log:<br />
August 3, 2011 - skip decoding when Phorum&#039;s redirect.php is the executing script]]></description>
            <dc:creator>Phil Connolly</dc:creator>
            <category>v5/v6 Modules/Add-Ons</category>
            <pubDate>Mon, 22 Nov 2010 11:10:55 -0600</pubDate>
        </item>
    </channel>
</rss>
