[Cs-content-commits] SF.net SVN: cs-content:[341] trunk/1.0/cs_genericPage.class.php
PHP Templating & Includes System
Brought to you by:
crazedsanity
|
From: <cra...@us...> - 2009-01-30 20:40:30
|
Revision: 341
http://cs-content.svn.sourceforge.net/cs-content/?rev=341&view=rev
Author: crazedsanity
Date: 2009-01-30 20:40:25 +0000 (Fri, 30 Jan 2009)
Log Message:
-----------
Fix parsing of block rows (#230).
/cs_genericPage.class.php:
* get_block_row_defs():
-- fix regex for begin and end statements so the entire definition can
be put onto a single line.
Modified Paths:
--------------
trunk/1.0/cs_genericPage.class.php
Modified: trunk/1.0/cs_genericPage.class.php
===================================================================
--- trunk/1.0/cs_genericPage.class.php 2009-01-30 14:32:17 UTC (rev 340)
+++ trunk/1.0/cs_genericPage.class.php 2009-01-30 20:40:25 UTC (rev 341)
@@ -530,14 +530,14 @@
if(strlen($templateContents) >= 31) {
//looks good to me. Run the regex...
$flags = PREG_PATTERN_ORDER;
- $reg = "/<!-- BEGIN (.+) -->/";
+ $reg = "/<!-- BEGIN (\S{1,}) -->/";
preg_match_all($reg, $templateContents, $beginArr, $flags);
$beginArr = $beginArr[1];
- $endReg = "/<!-- END (.+) -->/";
+ $endReg = "/<!-- END (\S{1,}) -->/";
preg_match_all($endReg, $templateContents, $endArr, $flags);
$endArr = $endArr[1];
-
+
//create a part of the array that shows any orphaned "BEGIN" statements (no matching "END"
// statement), and orphaned "END" statements (no matching "BEGIN" statements)
// NOTE::: by doing this, should easily be able to tell if the block rows were defined
@@ -577,6 +577,7 @@
$rowDefs = $this->get_block_row_defs($templateVar);
$useTheseBlockRows = $rowDefs['ordered'];
+
$retval = array();
if(is_array($useTheseBlockRows)) {
foreach($useTheseBlockRows as $blockRowName)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|