Hello all, I came across this issue while using the Joomla-SMF bridge for a portuguese site. When viewing the SMF forum, in some parts of the site the page title would show up mangled. For example, instead of Tópicos actualizados, it would apear Tópicos actualizados.
The issue seems to be a conflict in the way such strings are handled in SMF and Joomla! The problematic strings come from the Portuguese SMF translation, in which strings are already expressed using html entities. This works fine for a standalone SMF instaltion, but when integrated into Joomla!, the bridge grabs the page title from SMF and passes it to Joomla!. Inside Joomla! the string is parsed by htmlspecialchars() and becomes mangled.
I fixed this by parsing the strings retrived from SMF before passing them to Joomla!, but I'm not sure it's the best way.
Below is the changes I used. Any comments are welcome.
diff -Nur com_joomla_smf_forum_1.0.2a/smf.php com_joomla_smf_forum_1.0.2a.htmlentities/smf.php --- com_joomla_smf_forum_1.0.2a/smf.php 2005-10-26 09:10:02.000000000 +0100 +++ com_joomla_smf_forum_1.0.2a.htmlentities/smf.php 2005-12-17 01:31:22.413529800 +0000 @@ -101,10 +101,11 @@ unset($MH_WARNING); }
-if (isset($context['page_title'])) { - $mainframe->SetPageTitle( $context['page_title'] ); - $mainframe->prependMetaTag( 'description', $context['page_title'].'.'); - $keywords = implode(", ", str_word_count($context['page_title'], 1)); +if (isset($context['page_title'])) { + $page_title = html_entity_decode($context['page_title'], ENT_NOQUOTES, _ISO); + $mainframe->SetPageTitle( $page_title ); + $mainframe->prependMetaTag( 'description', $page_title.'.'); + $keywords = implode(", ", str_word_count($page_title, 1)); $mainframe->prependMetaTag( 'keywords', $keywords); unset($keywords, $str); } @@ -131,4 +132,4 @@ exit; }
-?> \ No newline at end of file +?>
|
|