Page MenuHomePhabricator

Template not evaluated if call is prefixed with whitespace
Closed, ResolvedPublic

Description

Author: gunter.schmidt

Description:
If you have your pages using the template with "{{ TemplateName ..." it is not evaluated, as there is a
blank between the brackets and the templatename.

Example is set up on dpl-webpage.


Version: unspecified
Severity: normal
URL: http://semeb.com/dpldemo/index.php/Bug_Reports#Template_not_evaluated

Details

Reference
bz9052

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:36 PM
bzimport set Reference to bz9052.
bzimport added a subscriber: Unknown Object (MLST).

gunter.schmidt wrote:

Already found a solution:

<pre>
#DynamicPageList2Include.php

function wfDplLstIncludeTemplate($parser, $page='', $template1='', $template2='')
{
$text = $parser->fetchTemplate(Title::newFromText($page));
+ do
+ $text = str_replace('{{ ', '{{', $text, $tc);
+ while ($tc > 0);

if ( preg_match( "/\{\{".$template1."/im", $text, $m, PREG_OFFSET_CAPTURE) ) {

</pre>

robchur wrote:

Looks like DPL2 isn't parsing the templates right.

gunter.schmidt wrote:

Fixed with 0.9.8