- Timestamp:
- Feb 16, 2008, 2:22:47 PM (17 years ago)
- Location:
- branches/branch-1_7/include
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/branch-1_7/include/common.inc.php
r2202 r2212 3 3 // | PhpWebGallery - a PHP based picture gallery | 4 4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | 5 // | Copyright (C) 2003-200 7PhpWebGallery Team - http://phpwebgallery.net |5 // | Copyright (C) 2003-2008 PhpWebGallery Team - http://phpwebgallery.net | 6 6 // +-----------------------------------------------------------------------+ 7 7 // | branch : BSF (Best So Far) … … 126 126 'array_intersect_key', //PHP 5 >= 5.1.0RC1 127 127 'hash_hmac', //(hash) - enabled by default as of PHP 5.1.2 128 'preg_last_error', // PHP 5 >= 5.2.0 128 129 ) as $func) 129 130 { -
branches/branch-1_7/include/functions_xml.inc.php
r1900 r2212 3 3 // | PhpWebGallery - a PHP based picture gallery | 4 4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | 5 // | Copyright (C) 2003-200 5PhpWebGallery Team - http://phpwebgallery.net |5 // | Copyright (C) 2003-2008 PhpWebGallery Team - http://phpwebgallery.net | 6 6 // +-----------------------------------------------------------------------+ 7 7 // | branch : BSF (Best So Far) 8 // | file : $ RCSfile$8 // | file : $Id$ 9 9 // | last update : $Date$ 10 10 // | last modifier : $Author$ … … 66 66 return $attribute.'="'.htmlspecialchars($value, ENT_QUOTES).'" '; 67 67 } 68 68 69 69 // The function getChild returns the first child 70 70 // exemple : getChild( "<table><tr>XXX</tr><tr>YYY</tr></table>", "tr" ) … … 75 75 $regex.= '(\s*\/>|>.*<\/'.$node.'>)/U'; 76 76 77 preg_match( $regex, $document, $out ); 78 return $out[0]; 77 if 78 ( 79 preg_match( $regex, $document, $out ) 80 or 81 preg_last_error() == PREG_NO_ERROR 82 ) 83 { 84 return $out[0]; 85 } 86 else 87 { 88 die('getChild: error ['.preg_last_error().'] with preg_match function'); 89 } 79 90 } 80 91 … … 90 101 $regex.= '(\s*\/>|>.*<\/'.$node.'>)/U'; 91 102 92 preg_match_all( $regex, $document, $out ); 93 return $out[0]; 103 if 104 ( 105 preg_match_all( $regex, $document, $out ) 106 or 107 preg_last_error() == PREG_NO_ERROR 108 ) 109 { 110 return $out[0]; 111 } 112 else 113 { 114 die('getChild: error ['.preg_last_error().'] with preg_match_all function'); 115 } 94 116 } 95 117 96 118 // get_CodeXML places the content of a text file in a PHP variable and 97 119 // return it. If the file can't be opened, returns false. 98 120 function getXmlCode( $filename ) 99 121 { 122 if (function_exists('ini_set')) 123 { 124 // limit must be growed with php5 and "big" listing file 125 ini_set("pcre.backtrack_limit", pow(2, 32)); 126 } 127 100 128 $file = fopen( $filename, 'r' ); 101 129 if ( !$file )
Note: See TracChangeset
for help on using the changeset viewer.