Index: branches/RC/core/kernel/nparser/nparser.php =================================================================== diff -u -r11107 -r11214 --- branches/RC/core/kernel/nparser/nparser.php (.../nparser.php) (revision 11107) +++ branches/RC/core/kernel/nparser/nparser.php (.../nparser.php) (revision 11214) @@ -49,14 +49,19 @@ { $data = file_get_contents($pre_parsed['tname']); - $this->CompileRaw($data, $pre_parsed['tname'], $template_name); + if (!$this->CompileRaw($data, $pre_parsed['tname'], $template_name)) { + // compilation failed during errors in template +// trigger_error('Template "' . $template_name . '" not compiled because of errors', E_USER_WARNING); + return false; + } - // saving compiled version + // saving compiled version (only when compilation was successful) $compiled = fopen($pre_parsed['fname'], 'w'); if (!fwrite($compiled, $this->Buffers[0])) { trigger_error('Saving compiled template failed', E_USER_ERROR); } fclose($compiled); + return true; } @@ -130,6 +135,8 @@ $this->Buffers[$this->Level] = preg_replace('//s', '', $this->Buffers[$this->Level]); // remove hidden comments IB#23065 // $this->Buffers[$this->Level] .= 'CacheEnd();\n}\n"." ?".">\n"; // $this->Buffers[$this->Level] = str_replace('__@@__DefinitionsMarker__@@__', $this->Definitions, $this->Buffers[$this->Level]); + + return true; } function SplitParamsStr($params_str) @@ -142,6 +149,7 @@ foreach ($rets AS $key => $val){ $values[$val[1]] = str_replace('\\' . $val[2], $val[2], $val[3]); } + return $values; } @@ -156,13 +164,17 @@ $splited['prefix'] = $parts[2] ? $parts[1] : '__auto__'; $splited['name'] = $parts[2] ? $parts[2] : $parts[1]; $splited['attrs'] = $parts[3]; + return $splited; } function ProcessTag($tag) { $splited = $this->SplitTag($tag); - if ($splited === false) return false; + if ($splited === false) { + return false; + } + $tag = array_merge($tag, $splited); $tag['processed'] = false; $tag['NP'] = $this->SplitParamsStr($tag['attrs']); @@ -179,7 +191,9 @@ $this->Buffers[$this->Level] = ''; $this->Cachable[$this->Level] = true; $open_code = $instance->Open($tag); - if ($open_code === false) return false; + if ($open_code === false) { + return false; + } $o .= $open_code; }