Changeset 930

Show
Ignore:
Timestamp:
05/07/08 11:24:18 (2 months ago)
Author:
laurentj
Message:

fixed a warning generated during template compilation

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.0.x/lib/jelix/tpl/jTplCompiler.class.php

    r929 r930  
    190190        $tplcontent = preg_replace("!{literal}(.*?){/literal}!s", '{literal}', $tplcontent); 
    191191 
    192         $tplcontent = preg_replace_callback("/{((.).*?)}/s", array($this,'_callback'), $tplcontent); 
     192#if PHP50 || PHP51 
     193        // there is a @ because an exception in the callback function generates a warning in PHP 5.1.2 
     194        // (not in PHP 5.2) 
     195        $tplcontent = @preg_replace_callback("/{((.).*?)}/sm", array($this,'_callback'), $tplcontent); 
     196#else 
     197        $tplcontent = preg_replace_callback("/{((.).*?)}/sm", array($this,'_callback'), $tplcontent); 
     198#endif 
    193199 
    194200        $tplcontent = preg_replace('/\?>\n?<\?php/', '', $tplcontent); 
  • branches/1.0.x/lib/jelix/tpl/jTplCompiler.class.php

    r929 r930  
    190190        $tplcontent = preg_replace("!{literal}(.*?){/literal}!s", '{literal}', $tplcontent); 
    191191 
    192         $tplcontent = preg_replace_callback("/{((.).*?)}/s", array($this,'_callback'), $tplcontent); 
     192#if PHP50 || PHP51 
     193        // there is a @ because an exception in the callback function generates a warning in PHP 5.1.2 
     194        // (not in PHP 5.2) 
     195        $tplcontent = @preg_replace_callback("/{((.).*?)}/sm", array($this,'_callback'), $tplcontent); 
     196#else 
     197        $tplcontent = preg_replace_callback("/{((.).*?)}/sm", array($this,'_callback'), $tplcontent); 
     198#endif 
    193199 
    194200        $tplcontent = preg_replace('/\?>\n?<\?php/', '', $tplcontent); 
  • branches/1.0.x/lib/jelix/tpl/jTplCompiler.class.php

    r929 r930  
    190190        $tplcontent = preg_replace("!{literal}(.*?){/literal}!s", '{literal}', $tplcontent); 
    191191 
    192         $tplcontent = preg_replace_callback("/{((.).*?)}/s", array($this,'_callback'), $tplcontent); 
     192#if PHP50 || PHP51 
     193        // there is a @ because an exception in the callback function generates a warning in PHP 5.1.2 
     194        // (not in PHP 5.2) 
     195        $tplcontent = @preg_replace_callback("/{((.).*?)}/sm", array($this,'_callback'), $tplcontent); 
     196#else 
     197        $tplcontent = preg_replace_callback("/{((.).*?)}/sm", array($this,'_callback'), $tplcontent); 
     198#endif 
    193199 
    194200        $tplcontent = preg_replace('/\?>\n?<\?php/', '', $tplcontent); 
  • branches/1.0.x/lib/jelix/tpl/jTplCompiler.class.php

    r929 r930  
    190190        $tplcontent = preg_replace("!{literal}(.*?){/literal}!s", '{literal}', $tplcontent); 
    191191 
    192         $tplcontent = preg_replace_callback("/{((.).*?)}/s", array($this,'_callback'), $tplcontent); 
     192#if PHP50 || PHP51 
     193        // there is a @ because an exception in the callback function generates a warning in PHP 5.1.2 
     194        // (not in PHP 5.2) 
     195        $tplcontent = @preg_replace_callback("/{((.).*?)}/sm", array($this,'_callback'), $tplcontent); 
     196#else 
     197        $tplcontent = preg_replace_callback("/{((.).*?)}/sm", array($this,'_callback'), $tplcontent); 
     198#endif 
    193199 
    194200        $tplcontent = preg_replace('/\?>\n?<\?php/', '', $tplcontent); 
  • trunk/lib/jelix/tpl/jTplCompiler.class.php

    r929 r930  
    190190        $tplcontent = preg_replace("!{literal}(.*?){/literal}!s", '{literal}', $tplcontent); 
    191191 
     192#if PHP50 || PHP51 
     193        // there is a @ because an exception in the callback function generates a warning in PHP 5.1.2 
     194        // (not in PHP 5.2) 
     195        $tplcontent = @preg_replace_callback("/{((.).*?)}/sm", array($this,'_callback'), $tplcontent); 
     196#else 
    192197        $tplcontent = preg_replace_callback("/{((.).*?)}/sm", array($this,'_callback'), $tplcontent); 
     198#endif 
    193199 
    194200        $tplcontent = preg_replace('/\?>\n?<\?php/', '', $tplcontent); 
  • trunk/lib/jelix/tpl/jTplCompiler.class.php

    r929 r930  
    190190        $tplcontent = preg_replace("!{literal}(.*?){/literal}!s", '{literal}', $tplcontent); 
    191191 
     192#if PHP50 || PHP51 
     193        // there is a @ because an exception in the callback function generates a warning in PHP 5.1.2 
     194        // (not in PHP 5.2) 
     195        $tplcontent = @preg_replace_callback("/{((.).*?)}/sm", array($this,'_callback'), $tplcontent); 
     196#else 
    192197        $tplcontent = preg_replace_callback("/{((.).*?)}/sm", array($this,'_callback'), $tplcontent); 
     198#endif 
    193199 
    194200        $tplcontent = preg_replace('/\?>\n?<\?php/', '', $tplcontent); 
  • trunk/lib/jelix/tpl/jTplCompiler.class.php

    r929 r930  
    190190        $tplcontent = preg_replace("!{literal}(.*?){/literal}!s", '{literal}', $tplcontent); 
    191191 
     192#if PHP50 || PHP51 
     193        // there is a @ because an exception in the callback function generates a warning in PHP 5.1.2 
     194        // (not in PHP 5.2) 
     195        $tplcontent = @preg_replace_callback("/{((.).*?)}/sm", array($this,'_callback'), $tplcontent); 
     196#else 
    192197        $tplcontent = preg_replace_callback("/{((.).*?)}/sm", array($this,'_callback'), $tplcontent); 
     198#endif 
    193199 
    194200        $tplcontent = preg_replace('/\?>\n?<\?php/', '', $tplcontent); 
  • trunk/lib/jelix/tpl/jTplCompiler.class.php

    r929 r930  
    190190        $tplcontent = preg_replace("!{literal}(.*?){/literal}!s", '{literal}', $tplcontent); 
    191191 
     192#if PHP50 || PHP51 
     193        // there is a @ because an exception in the callback function generates a warning in PHP 5.1.2 
     194        // (not in PHP 5.2) 
     195        $tplcontent = @preg_replace_callback("/{((.).*?)}/sm", array($this,'_callback'), $tplcontent); 
     196#else 
    192197        $tplcontent = preg_replace_callback("/{((.).*?)}/sm", array($this,'_callback'), $tplcontent); 
     198#endif 
    193199 
    194200        $tplcontent = preg_replace('/\?>\n?<\?php/', '', $tplcontent); 
Download in other formats: Unified Diff Zip Archive