From baea48b9cd237ef0bc5862807d72889e8a55d118 Mon Sep 17 00:00:00 2001 From: mohrt Date: Mon, 30 Apr 2001 14:08:00 +0000 Subject: [PATCH] update paths for windows (c:) --- FAQ | 2 +- NEWS | 4 ++-- RELEASE_NOTES | 14 +++++++------- Smarty.class.php | 3 +-- libs/Smarty.class.php | 3 +-- misc/fix_vars.php | 1 + 6 files changed, 13 insertions(+), 14 deletions(-) diff --git a/FAQ b/FAQ index 7e3eb331..aed3f174 100644 --- a/FAQ +++ b/FAQ @@ -139,4 +139,4 @@ Q: My ISP did not setup the PEAR repository, nor will they set it up. How do I A: The easiest thing to do is grab all of PEAR and install it locally for your own use. There's nothing that says PEAR must be installed in its default directory. There won't be a version of Smarty that runs without PEAR, as it - quite dependant on it. + dependant on it, and may become moreso in the future. diff --git a/NEWS b/NEWS index 87abb5a6..5b56fde3 100644 --- a/NEWS +++ b/NEWS @@ -13,8 +13,8 @@ Version 1.4.0 - updated GLOBAL_ASSIGN to take SCRIPT_NAME from HTTP_SERVER_VARS instead of global variable. You can also assign several variables in one shot with an array. (Monte, Roman Neuhauser) - - added template filters, register_filer() and unregister_filter() API - functions. (Monte) + - added template prefilters, register_prefilter() and + unregister_prefilter() API functions. (Monte) - added RELEASE_NOTES file to distribution. (Monte) - moved CREDITS out of manual into its own file. (Monte) - added register_resource() and unregister_resource() API functions. (Monte) diff --git a/RELEASE_NOTES b/RELEASE_NOTES index a84e90fe..6884bd85 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -54,10 +54,10 @@ bit smarter at this. It will take a unix timestamp, a mysql timestamp, or any date string that is parsable by strtotime, such as 10/01/2001 or 2001-10-01, etc. Just give some formats a try and see what works. -Smarty now has template filters, meaning that you can run your templates +Smarty now has template prefilters, meaning that you can run your templates through custom functions before they are compiled. This is good for things like removing unwanted comments, keeping an eye on words or functionality people are -putting in templates, translating XML -> HTML, etc. See the register_filter +putting in templates, translating XML -> HTML, etc. See the register_prefilter documentation for more info. Another addition are the so-called compiler functions. These are custom @@ -65,7 +65,7 @@ functions registered by the user that are executed at compilation time of the template. They can be used to inject PHP code or time-sensitive static content into the compiled template. -The run-time custom functions are now passed Smarty object as the second +The run-time custom functions are now passed the Smarty object as the second parameter. This can be used, for example, to assign or clear template variables from inside the custom function. @@ -73,7 +73,7 @@ clear_compile_dir() was added for clearing out compiled versions of your templates. Not something normally needed, but you may have a need for this if you have $compile_check set to false and you periodically update templates via some automated process. As of 1.4.0, uncompiled templates _always_ get -compiled, regardless of $compile_check setting, although they won't be checked +compiled regardless of $compile_check setting, although they won't be checked for recompile if $compile_check is set to false. You can now refer to properties of objects assigned from PHP by using the '->' @@ -89,9 +89,9 @@ The format of the files created in the $compile_dir are now a bit different. The compiled template filename is the template resource name url-encoded. Therefore, all compiled files are now in the top directory of $compile_dir. This was done to make way for arbitrary template resources. Each compiled -template has a header that states what template resource was used to create it. -From a unix command prompt, you can use "head -2 *" to see the first two lines -of each file. +template also has a header that states what template resource was used to +create it. From a unix command prompt, you can use "head -2 *" to see the first +two lines of each file. When upgrading to 1.4.0, you will want to clear out all your old files in the $compile_dir. If you have $compile_check set to false and the compiled template diff --git a/Smarty.class.php b/Smarty.class.php index b6c2524b..d1a57c22 100644 --- a/Smarty.class.php +++ b/Smarty.class.php @@ -624,7 +624,7 @@ class Smarty switch ($resource_type) { case 'file': - if ($resource_name{0} != '/') { + if (!preg_match("/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/",$resource_name)) { // relative pathname to $template_dir $resource_name = $this->template_dir.'/'.$resource_name; } @@ -637,7 +637,6 @@ class Smarty return false; } break; - default: if (isset($this->resource_funcs[$resource_type])) { $funcname = $this->resource_funcs[$resource_type]; diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index b6c2524b..d1a57c22 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -624,7 +624,7 @@ class Smarty switch ($resource_type) { case 'file': - if ($resource_name{0} != '/') { + if (!preg_match("/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/",$resource_name)) { // relative pathname to $template_dir $resource_name = $this->template_dir.'/'.$resource_name; } @@ -637,7 +637,6 @@ class Smarty return false; } break; - default: if (isset($this->resource_funcs[$resource_type])) { $funcname = $this->resource_funcs[$resource_type]; diff --git a/misc/fix_vars.php b/misc/fix_vars.php index f4936745..ce50a964 100644 --- a/misc/fix_vars.php +++ b/misc/fix_vars.php @@ -1,6 +1,7 @@ 1.4.0. * This script will convert Smarty variable references from the old format to * the new one. For example, what used to look like $section1/foo.bar will now * be $foo[section1].bar. This allows for more readable syntax and also allows