Changeset 795


Ignore:
Timestamp:
Jun 21, 2005, 10:39:29 PM (19 years ago)
Author:
plg
Message:
  • bug fixed when a language value contains a simple quote
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/template.php

    r794 r795  
    157157      // Run the compiled code.
    158158      $_str = '';
     159//      echo '<pre>'.($this->compiled_code[$handle]).'</pre>';
     160      $fp = @fopen( './log/debug.log', 'a+' );
     161      fwrite( $fp, "\n\n" );
     162      fwrite( $fp, $this->compiled_code[$handle] );
     163      fclose( $fp );
    159164      eval($this->compiled_code[$handle]);
    160165      $this->output.= $_str;
     
    328333  function compile($code, $do_not_echo = false, $retvar = '')
    329334    {
     335      // PWG specific : communication between template and $lang
     336      $code = preg_replace('/\{lang:([^}]+)\}/e', "l10n('$1')", $code);
     337           
    330338      // replace \ with \\ and then ' with \'.
    331339      $code = str_replace('\\', '\\\\', $code);
    332340      $code = str_replace('\'', '\\\'', $code);
    333 
    334       // PWG specific : communication between template and $lang
    335       $code = preg_replace('/\{lang:([^}]+)\}/e', "l10n('$1')", $code);
    336341     
    337342      // change template varrefs into PHP varrefs
Note: See TracChangeset for help on using the changeset viewer.