Skip to content

Commit

Permalink
- bugfix add addition check for OS type on normalization of file path #…
Browse files Browse the repository at this point in the history
  • Loading branch information
uwetews committed Dec 20, 2015
1 parent 6483164 commit 78243be
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions change_log.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
20.12.2015
- bugfix failure when the default resource type was set to 'extendsall' https://github.com/smarty-php/smarty/issues/123
- update compilation of Smarty special variables
- bugfix add addition check for OS type on normalizaition of file path https://github.com/smarty-php/smarty/issues/134

19.12.2015
- bugfix using $smarty.capture.foo in expressions could fail https://github.com/smarty-php/smarty/pull/138
Expand Down
4 changes: 2 additions & 2 deletions libs/Smarty.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class Smarty extends Smarty_Internal_TemplateBase
/**
* smarty version
*/
const SMARTY_VERSION = '3.1.29-dev/15';
const SMARTY_VERSION = '3.1.29-dev/16';

/**
* define variable scopes
Expand Down Expand Up @@ -1178,7 +1178,7 @@ public function _realpath($path, $realpath = null)
$path = str_replace($nds, DS, $path);
}

if ($realpath === true && $path[0] !== '/' && $path[1] !== ':') {
if ($realpath === true && (($path[0] !== '/' && DS == '/') || ($path[1] !== ':' && DS != '/'))) {
$path = getcwd() . DS . $path;
}
while ((strpos($path, '.' . DS) !== false) || (strpos($path, DS . DS) !== false)) {
Expand Down

0 comments on commit 78243be

Please sign in to comment.