Alternative heading

A place to report and discuss bugs - please mention CMSimple-version, server, platform and browser version
Post Reply
tanavots
Posts: 72
Joined: Sat Feb 25, 2012 4:18 pm

Alternative heading

Post by tanavots » Sat Sep 28, 2013 5:18 pm

Hey,
I have problem with Alternative heading. If it start with number (1, 2 .. 100 etc), then (first) number does not appear (100 --> 00) and heading also don't get css format settings.

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Alternative heading

Post by cmb » Sat Sep 28, 2013 5:57 pm

Indeed, that's a bug. You have to change plugins/page_params/index.php line 68 (in CMSimple_XH 1.5.9):

Code: Select all

            $c[$pd_s] = preg_replace($temp, '${1}'.(string)$pd_current['heading'].'\\2',$c[$pd_s]);
BTW: now I know what the space was meant for, that was removed in r248 :)
Christoph M. Becker – Plugins for CMSimple_XH

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Alternative heading

Post by cmb » Sun Feb 23, 2014 2:49 pm

I found that there are still potential issues. E.g. using "$1" as alternative heading will not output an heading at all, but rather invalid HTML, while a backslash as last character has even stranger results.

The problem is that $pd_current['heading'] is not properly escaped; the following will take care for that:

Code: Select all

$c[$pd_s] = preg_replace($temp, '${1}'.addcslashes($pd_current['heading'],'$\\').'$2',$c[$pd_s]); 
Christoph M. Becker – Plugins for CMSimple_XH

Post Reply