Bug tracker

This ticket has been moved to our new tracker. Open Ticket PHPBB3-8451 now.

build_url() in functions.php return value has phpbb_path hardcoded (fix completed in vcs)

I am the owner/author of RokBridge, a phpBB3 bridge for Joomla. We try to keep our bridge as clean as possible, but there are a few issues that force us to patch minor things in phpBB3. One of these is the build_url() function in the functions.php file. This function returns:

return $phpbb_root_path . str_replace('&', '&', $redirect);

I was wandering if this could not just be:

return str_replace('&', '&', $redirect);

This removes the hardcoding, and still seems to work fine. This way it allows the bridge to function properly.

Comments / History

Posted by DavidIQ (MOD Team Leader) on Jun 27th 2009, 22:36

Can you provide an example as to why you require this change for your bridge?

Posted by rhuk on Jun 27th 2009, 22:55

The bridge sits in a different directory than the phpbb3 core and then translates the regular phpbb3 urls to the bridge urls. For example, you may have phpbb3 installed at /phpbb3 and the bridge installed at /forum. All the URLs are translated, but these filesystem based paths cannot be translated as they are not output as URls but are filepaths used internally.

I discussed this with nils on the #phpbb-coding irc channel and he suggested I submit this as a bug. I've been working with Nils and David for a couple of years, and pretty much these two bugs are the only ones that are holding us back from having a completely hack-free solution.

You can download the bridge to have a look at how it works here:

http://www.rocekttheme.com/extensions-joomla/rokbridge

or you can see it in action here:

http://www.rockettheme.com/forum

and the phpbb3 url is actually:

http://www.rockettheme.com/distribution

Posted by rhuk on Jun 27th 2009, 23:00

Hmm.. my last reply was actually referring to the filelist() bug i submitted after this one.

This particular issue with the phpbb3 path being prepended causes certain urls to get the phpbb3 path inserted in like this

http://yoursite.com/bridge_path/phpbb_path/url...

when the bridge is located:

http://yoursite.com/bridge_path/

and phpbb3 is located:

http://yoursite.com/phpbb_path/

Removing that $phpbb_root_path var fixes the problem and we've not noticed any side affects. I'm not sure why it was inserted there. Obviously its your call and you know better than us it's purpose, but right now we have a patching function that removes this reference and that has resolved the issues we were seeing regarding it.

Posted by rhuk on Jun 27th 2009, 23:09

One more comment, I think this was specifically related to problems around redirection. The main one I remember was when you marked "All forums Read" on the main page of the forum:

From this bridged page:

http://home.rhuk.net/joomla/rokbridge/forum/index.php

Clicking "Mark forums read" causes:

[phpBB Debug] PHP Notice: in file /includes/functions.php on line 2059: parse_url(/http://home.rhuk.net/joomla/rokbridge/forum/index.php) [function.parse-url]: Unable to parse URL

Then the redirect sends you to:

http://home.rhuk.net/joomla/rokbridge/p ... ark=forums

The removal of that $phpbb_root_path fixes it.

Posted by leviatan21 on Jun 28th 2009, 04:12

a possible solution can be this ?
Find :
Code: Select all
function build_url($strip_vars = false)

Replace with :
Code: Select all
function build_url($strip_vars = false, $bridge = false)

Find :
Code: Select all
return ($bridge ? $phpbb_root_path : '') . str_replace('&', '&', $redirect);

Replace with :
Code: Select all
return ($bridge ? '' : $phpbb_root_path) . str_replace('&', '&', $redirect);


You can use this way in your bridge code
Code: Select all
build_url( false, true)

Edited post #166515

Action performed by leviatan21 on Jun 28th 2009, 04:12

Changed ticket severity from "Uncategorised/normal" to "Severe"

Action performed by naderman (Development Team Leader) on Jul 14th 2009, 11:53

Posted by Kellanved (Former Team Member) on Jul 14th 2009, 12:01

Removing the root path would lead to problems in the ACP and other phpBB pages using a different directory. We're investigating.

Assigned ticket to user "Acyd Burn"

Action performed by Kellanved (Former Team Member) on Jul 18th 2009, 09:07

Posted by Acyd Burn (Server Manager) on Aug 1st 2009, 13:07

Strange... i now installed Joomla and the bridge and do not have these problems. Marking forums work as intended.

Posted by Acyd Burn (Server Manager) on Aug 1st 2009, 13:07

Oh, and yes, i of course did not apply the patch. ;)

Ticket details

Related SVN changesets