& in breadcrumbs and page titles

A place to discuss the testing process in beta cycles or against SVN for the CMS Made Simple CORE package.
Locked
martin42
Forum Members
Forum Members
Posts: 126
Joined: Sat Aug 20, 2005 11:35 pm

& in breadcrumbs and page titles

Post by martin42 »

Some of my menu items say things like:

      "Site Map & Search"

In older releases, this was OK.

In 0.13, it's OK in the CSSMenu, but displays literally "&" in the breadcrumb trail, and in the page title.

Any ideas?

Thanks!
martin42
Forum Members
Forum Members
Posts: 126
Joined: Sat Aug 20, 2005 11:35 pm

Re: & in breadcrumbs and page titles

Post by martin42 »

OK, I've made a one-line patch to lib/misc_functions.php which fixes this problem for now.

The 0.13 code is trying to be helpful by escaping "&" signs automatically, but it doesn't do that in the CSS Menu or in the Site Map.  The best thing is to use "&" yourself in menu text and page titles, but if you do that, then the automatic code messes things up...

Here's the patch, to un-do the change when it's not wanted.  It's just the last line of this block:-

Code: Select all

function my_htmlentities($val)
{
        if ($val == "")
        {
                return "";
        }
        $val = str_replace( " ", " ", $val );

        //Remove sneaky spaces
        // $val = str_replace( chr(0xCA), "", $val );

        $val = str_replace( "&"            , "&"         , $val );
        $val = str_replace( "&"    , "&"         , $val );    # This is the new line
The only snag with this is that you now can't have a page that literally displays "&".  I can see this being a pain if you write a site about web design.  So it would be better to sit down and fix the actual problem if possible.  This is just a quick bodge for now.
Locked

Return to “[locked] Quality Assurance”