My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 3: patch to improve handling of phpBB3 tags with bb_uids in them
  Back to list
Status:  New
Owner:  ----


 
Reported by google.e...@mamber.net, Jan 4, 2012
Thanks for the great code; it saved me a lot of time.

I made one fix to the way BB tags with uids are handled, which was necessary for the translation to work for me.  In topic.tpl.php, I replaced these two lines:

$text = str_replace(':' . $bid, '', $text);

$text = preg_replace('/\[(\/?)code:\d*\]/', '[\1code]', $text);

With this one

$text = preg_replace('/\[(\/?)(.+?):(.*?)\]/', '[$1$2]', $text);

I think that the $bid variable was being set to empty, so extracting it directly failed.  This new regular expression handles all the tags, including the [code] tags, and simply discards the colon and everything after it.


Powered by Google Project Hosting