Changeset 233
- Timestamp:
- 08/06/06 11:40:08 (2 years ago)
- Files:
-
- trunk/build/preprocessor.lib.php (modified) (2 diffs)
- trunk/build/tests/ppdatas/result_include1.txt (modified) (3 diffs)
- trunk/build/tests/ppdatas/result_include2.txt (added)
- trunk/build/tests/ppdatas/source_inc1.txt (modified) (2 diffs)
- trunk/build/tests/ppdatas/source_include2.txt (added)
- trunk/build/tests/ppdatas/subdir/inc_err.txt (modified) (1 diff)
- trunk/build/tests/ppdatas/subdir/source_inc.txt (modified) (1 diff)
- trunk/build/tests/testpreprocess.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/build/preprocessor.lib.php
r232 r233 198 198 $source[$nb]=false; 199 199 } 200 }elseif(preg_match('/^\#include \s+([\w\/\.\:]+)\s*$/m',$line,$m)){200 }elseif(preg_match('/^\#include(php)?\s+([\w\/\.\:]+)\s*$/m',$line,$m)){ 201 201 if($isOpen){ 202 $path = $m[ 1];202 $path = $m[2]; 203 203 if(!($path{0} == '/' || preg_match('/^\w\:\\.+$/',$path))){ 204 204 $path = realpath(dirname($filename).'/'.$path); … … 216 216 throw new jExceptionPreProc($filename,$nb,self::ERR_INVALID_FILENAME); 217 217 } 218 if($m[1] == 'php'){ 219 if(preg_match('/^\s*\<\?(?:php)?((?:.|\n)*)\?\>\s*$/m',$source[$nb],$ms)){ 220 $source[$nb] = $ms[1]; 221 } 222 } 218 223 }else{ 219 224 $source[$nb]=false; trunk/build/tests/ppdatas/result_include1.txt
r232 r233 7 7 dddddd 8 8 9 <?php 9 10 kkkkk 10 11 … … 13 14 14 15 mmmmm 16 ?> 15 17 16 18 … … 19 21 hhhhhh 20 22 21 kkkkkkk 23 jooooba 22 24 popopqsd 23 25 mlmlml trunk/build/tests/ppdatas/source_inc1.txt
r232 r233 1 1 <?php 2 2 kkkkk 3 3 … … 7 7 8 8 mmmmm 9 ?> trunk/build/tests/ppdatas/subdir/inc_err.txt
r232 r233 8 8 #endif 9 9 10 kkkkkkk 10 jooooba 11 11 #include foo.txt trunk/build/tests/ppdatas/subdir/source_inc.txt
r232 r233 8 8 #endif 9 9 10 kkkkkkk 10 jooooba 11 11 #include ../source_inc2.txt trunk/build/tests/testpreprocess.php
r232 r233 64 64 'source_include1.txt'=>array( 65 65 'result_include1.txt'=>array('FOO'=>'ok'), 66 ), 67 'source_include2.txt'=>array( 68 'result_include2.txt'=>array('FOO'=>'ok'), 66 69 ), 67 70
