News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Possible have working code blocks in wrapped forum?

Started by codlord, January 04, 2006, 01:57:51 PM

Previous topic - Next topic

codlord

Is it possible to get SMF code blocks with html tags etc in them working with a wrapped forum?
(the problem being that Joomla strips out html tags etc)

I am using the latest bridge (1.1.1) and Joomla 1.0.4

I have seen this post in the combined readme thread:
http://www.simplemachines.org/community/index.php?topic=25718.msg351330#msg351330
But the mosGetParam function has changed since then and although I have tried a few different things I can't seem to get code blocks working (fine if I go to forum direct without Joomla).

Anyone managed to get this working? Any tips? Any help appreciated...

my mosGetParam function is:

define( "_MOS_NOTRIM", 0x0001 );
define( "_MOS_ALLOWHTML", 0x0002 );
define( "_MOS_ALLOWRAW", 0x0004 );
function mosGetParam( &$arr, $name, $def=null, $mask=0 ) {
        static $noHtmlFilter = null;
        static $safeHtmlFilter = null;

        $return = null;
        if (isset( $arr[$name] )) {
                if (is_string( $arr[$name] )) {
                        if (!($mask&_MOS_NOTRIM)) {
                                $arr[$name] = trim( $arr[$name] );
                        }
                        if ($mask&_MOS_ALLOWRAW) {
                                // do nothing
                        } else if ($mask&_MOS_ALLOWHTML) {
                                // do nothing - compatibility mode
                                /*
                                if (is_null( $safeHtmlFilter )) {
                                        $safeHtmlFilter = new InputFilter( null, null, 1, 1 );
                                }
                                $arr[$name] = $safeHtmlFilter->process( $arr[$name] );
                                */
                        } else {
                                if (is_null( $noHtmlFilter )) {
                                        $noHtmlFilter = new InputFilter( /* $tags, $attr, $tag_method, $attr_method, $xss_auto */ );
                                }
                                $arr[$name] = $noHtmlFilter->process( $arr[$name] );
                        }
                        if (!get_magic_quotes_gpc()) {
                                $arr[$name] = addslashes( $arr[$name] );
                        }
                }
                return $arr[$name];
        } else {
                return $def;
        }
}


codlord

Nice one, swapping those two lines seems to do the trick.

thanks muchly  :D

Advertisement: