[Cs-content-commits] SF.net SVN: cs-content:[365] trunk/1.0/cs_genericPage.class.php
PHP Templating & Includes System
Brought to you by:
crazedsanity
From: <cra...@us...> - 2009-02-10 17:40:07
|
Revision: 365 http://cs-content.svn.sourceforge.net/cs-content/?rev=365&view=rev Author: crazedsanity Date: 2009-02-10 17:40:03 +0000 (Tue, 10 Feb 2009) Log Message: ----------- Fix issue with incorrectly stripping leading slash of path to main template. /cs_genericPage.class.php: * initialize_locals(): -- use preg_match_all() to determine number of matches; preg_match() will always return 1 if there is one or more matches. 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-02-09 20:33:21 UTC (rev 364) +++ trunk/1.0/cs_genericPage.class.php 2009-02-10 17:40:03 UTC (rev 365) @@ -63,7 +63,10 @@ //replace multiple slashes with a single one to avoid confusing other logic... $mainTemplateFile = preg_replace('/(\/){2,}/', '/', $mainTemplateFile); - if(preg_match('/\//', $mainTemplateFile) == 1 && preg_match('/^/', $mainTemplateFile)) { + + $showMatches=array(); + $numMatches = preg_match_all('/\//', $mainTemplateFile, $showMatches); + if($numMatches == 1 && preg_match('/^/', $mainTemplateFile)) { $mainTemplateFile = preg_replace('/^\//', '', $mainTemplateFile); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |