[PHPLIB-DEV] cvs commit From: carmelo (phplib-dev <email protected>)
Date: 01/15/00

From: carmelo
Date: Sat Jan 15 15:11:55 2000
Modified files:
      php-lib/php/template.inc

Log message:
ok I found he problem :
{$ is not interpreted the same way by php4 and php3,
so I made a patch to make it work on the wo versions
 without changing anything

Index: php-lib/php/template.inc
diff -u php-lib/php/template.inc:1.12 php-lib/php/template.inc:1.13
--- php-lib/php/template.inc:1.12 Sat Jan 15 09:14:27 2000
+++ php-lib/php/template.inc Sat Jan 15 15:11:24 2000
@@ -5,7 +5,7 @@
  * (C) Copyright 1999 NetUSE GmbH
  * Kristian Koehntopp
  *
- * $Id: template.inc,v 1.12 2000/01/15 08:14:27 carmelo Exp $
+ * $Id: template.inc,v 1.13 2000/01/15 14:11:24 carmelo Exp $
  *
  */
 
@@ -391,11 +391,22 @@
     preg_match_all($reg, $str, $m);
     
     /* implode the subblock to the requested alias */
- $str = preg_replace($reg, "{$alias}", $str);
-
- if ($this->debug & 4)
- printf("<b>implode_block:</b> extract <b>$varname</b> from <b>$parent</b>, leaving {$alias}<br>\n");
-
+ //check the version of php
+ //carmelo
+ $checkversion=1;
+ if ("{$checkversion}"==1) $str = preg_replace($reg, "\{$alias}", $str);
+ else $str = preg_replace($reg, "{$alias}", $str);
+
+ if ($this->debug & 4) {
+ $checkversion=1;
+ if ("{$checkversion}"==1) {
+ printf("<b>implode_block:</b> extract <b>$varname</b> from <b>$parent</b>, leaving \{$alias}<br>\n");
+ } else {
+ printf("<b>implode_block:</b> extract <b>$varname</b> from <b>$parent</b>, leaving {$alias}<br>\n");
+ }
+ }
+ //end change
+
     /* update variables */
     $this->set_var($varname, $m[1][0]);
     $this->set_var($parent, $str);

-
PHPLIB Developers Mailing List. Send messages to <phplib-dev <email protected>>.
To unsubscribe, send "unsubscribe" to <phplib-dev-request <email protected>> in
the body, not the subject, of your message.