prefilter.removeprids.php
1 <?php
2 /**
3  * wCMF - wemove Content Management Framework
4  * Copyright (C) 2005-2015 wemove digital solutions GmbH
5  *
6  * Licensed under the terms of the MIT License.
7  *
8  * See the LICENSE file distributed with this work for
9  * additional information.
10  */
11 
12 /*
13 * Smarty plugin
14 * -------------------------------------------------------------
15 * File: prefilter.removeprids.php
16 * Type: prefilter
17 * Name: removeprids
18 * Purpose: Remove protected region ids (used by wCMFGenerator).
19 * -------------------------------------------------------------
20 */
21 function smarty_prefilter_removeprids($tpl_source, \Smarty_Internal_Template $template) {
22  // remove protected regions
23  $tpl_source = preg_replace("/<!-- PROTECTED REGION .*? -->/U", "", $tpl_source);
24 
25  // remove any wCMFGenerator generated comments
26  return preg_replace("/<!--.*?ChronosGenerator.*?-->/s", "", $tpl_source);
27 }
28 ?>