Smarty 3.1.21 upgrade (see changelog)

This commit is contained in:
Ian 2014-10-19 16:19:01 +02:00
parent 563e5a704c
commit dcae514215
13 changed files with 2113 additions and 2136 deletions

View File

@ -1,4 +1,4 @@
Smarty 3.1.20
Smarty 3.1.21
Author: Monte Ohrt <monte at ohrt dot com >
Author: Uwe Tews

View File

@ -1,4 +1,29 @@
===== 3.1.20 ===== (10.09.2014)
===== 3.1.22-dev ===== (xx.xx.2014)
===== 3.1.21 ===== (18.10.2014)
18.10.2014
- composer moved to github
- add COMPOSER_RELEASE_NOTES
17.10.2014
- bugfix on $php_handling security and optimization of smarty_internal_parsetree (Thue Kristensen)
16.10.2014
- bugfix composer.json update
15.10.2014
- bugfix calling a new created cache file with fetch() and Smarty::CACHING_LIFETIME_SAVED multiple times did fail (forum 22350)
14.10.2014
- bugfix any tag placed within "<script language=php>" will throw a security exception to close all thinkable holes
- bugfix classmap in root composer.json should start at "libs/..."
- improvement cache is_file(file_exists) results of loadPlugin() to avoid unnecessary calls during compilation (Issue 201}
12.10.2014
- bugfix a comment like "<script{*foo*} language=php>" bypassed $php_handling checking (Thue Kristensen)
- bugfix change of 08.10.2014 could create E_NOTICE meassage when using "<?php" tags
- bugfix "<script language=php>" with $php_handling PHP_PASSTHRU was executed in {nocache} sections
===== 3.1.20 ===== (09.10.2014)
08.10.2014
- bugfix security mode of "<script language=php>" must be controlled by $php_handling property (Thue Kristensen)

View File

@ -2,7 +2,7 @@
/**
* Project: Smarty: the PHP compiling template engine
* File: Smarty.class.php
* SVN: $Id: Smarty.class.php 4848 2014-06-08 18:12:09Z Uwe.Tews@googlemail.com $
* SVN: $Id: Smarty.class.php 4897 2014-10-14 22:29:58Z Uwe.Tews@googlemail.com $
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
@ -24,7 +24,7 @@
* @author Uwe Tews
* @author Rodney Rehm
* @package Smarty
* @version 3.1-DEV
* @version 3.1.21
*/
/**
@ -110,7 +110,7 @@ class Smarty extends Smarty_Internal_TemplateBase
/**
* smarty version
*/
const SMARTY_VERSION = 'Smarty-3.1.20';
const SMARTY_VERSION = 'Smarty-3.1.21-dev';
/**
* define variable scopes
@ -662,6 +662,14 @@ class Smarty extends Smarty_Internal_TemplateBase
* @var array
*/
public $merged_templates_func = array();
/**
* Cache of is_file results of loadPlugin()
*
* @var array
*/
public static $_is_file_cache= array();
/**#@-*/
/**
@ -1372,9 +1380,8 @@ class Smarty extends Smarty_Internal_TemplateBase
// if type is "internal", get plugin from sysplugins
if (strtolower($_name_parts[1]) == 'internal') {
$file = SMARTY_SYSPLUGINS_DIR . strtolower($plugin_name) . '.php';
if (file_exists($file)) {
if (isset(self::$_is_file_cache[$file]) ? self::$_is_file_cache[$file] : self::$_is_file_cache[$file] = is_file($file)) {
require_once($file);
return $file;
} else {
return false;
@ -1392,9 +1399,8 @@ class Smarty extends Smarty_Internal_TemplateBase
$_plugin_dir . strtolower($_plugin_filename),
);
foreach ($names as $file) {
if (file_exists($file)) {
if (isset(self::$_is_file_cache[$file]) ? self::$_is_file_cache[$file] : self::$_is_file_cache[$file] = is_file($file)) {
require_once($file);
return $file;
}
if ($this->use_include_path && !preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $_plugin_dir)) {

View File

@ -70,6 +70,6 @@ class Smarty_Internal_Compile_Break extends Smarty_Internal_CompileBase
$compiler->trigger_template_error("cannot break {$_levels} level(s)", $compiler->lex->taglineno);
}
return "<?php break {$_levels}?>";
return "<?php break {$_levels};?>";
}
}

View File

@ -70,6 +70,6 @@ class Smarty_Internal_Compile_Continue extends Smarty_Internal_CompileBase
$compiler->trigger_template_error("cannot continue {$_levels} level(s)", $compiler->lex->taglineno);
}
return "<?php continue {$_levels}?>";
return "<?php continue {$_levels};?>";
}
}

View File

@ -135,12 +135,7 @@ class Smarty_Internal_Compile_Functionclose extends Smarty_Internal_CompileBase
}
$plugins_string .= "?>/*/%%SmartyNocache:{$compiler->template->properties['nocache_hash']}%%*/';?>\n";
}
// remove last line break from function definition
$last = count($compiler->parser->current_buffer->subtrees) - 1;
if ($compiler->parser->current_buffer->subtrees[$last] instanceof _smarty_linebreak) {
unset($compiler->parser->current_buffer->subtrees[$last]);
}
// if caching save template function for possible nocache call
// if caching save template function for possible nocache call
if ($compiler->template->caching) {
$compiler->template->properties['function'][$_name]['compiled'] .= $plugins_string
. $compiler->parser->current_buffer->to_smarty_php();

View File

@ -91,7 +91,7 @@ class _smarty_tag extends _smarty_parsetree
public function assign_to_var()
{
$var = sprintf('$_tmp%d', ++Smarty_Internal_Templateparser::$prefix_number);
$this->parser->compiler->prefix_code[] = sprintf('<?php ob_start();?>%s<?php %s=ob_get_clean();?>', $this->data, $var);
$this->parser->compiler->prefix_code[] = sprintf("<?php ob_start();\n%s\n%s=ob_get_clean();?>", preg_replace(array('/^\s*<\?php\s+/','/\s*\?>\s*$/'), '', $this->data), $var);
return $var;
}
@ -271,7 +271,9 @@ class _smarty_template_buffer extends _smarty_parsetree
*/
public function append_subtree(_smarty_parsetree $subtree)
{
$this->subtrees[] = $subtree;
if ($subtree->data !== '') {
$this->subtrees[] = $subtree;
}
}
/**
@ -283,50 +285,47 @@ class _smarty_template_buffer extends _smarty_parsetree
{
$code = '';
for ($key = 0, $cnt = count($this->subtrees); $key < $cnt; $key ++) {
if ($key + 2 < $cnt) {
if ($this->subtrees[$key] instanceof _smarty_linebreak && $this->subtrees[$key + 1] instanceof _smarty_tag && $this->subtrees[$key + 1]->data == '' && $this->subtrees[$key + 2] instanceof _smarty_linebreak) {
$key = $key + 1;
if ($this->subtrees[$key] instanceof _smarty_text) {
$subtree = $this->subtrees[$key]->to_smarty_php();
while ($key + 1 < $cnt && ($this->subtrees[$key+1] instanceof _smarty_text || $this->subtrees[$key +1]->data == '')) {
$key++;
if ($this->subtrees[$key]->data == '') {
continue;
}
$subtree .= $this->subtrees[$key]->to_smarty_php();
}
if ($subtree == '') {
continue;
}
if (substr($this->subtrees[$key]->data, - 1) == '<' && $this->subtrees[$key + 1]->data == '' && substr($this->subtrees[$key + 2]->data, - 1) == '?') {
$key = $key + 2;
$code .= preg_replace('/(<%|%>|<\?php|<\?|\?>|<\/?script)/', "<?php echo '\$1'; ?>\n", $subtree);
continue;
}
if ($this->subtrees[$key] instanceof _smarty_tag) {
$subtree = $this->subtrees[$key]->to_smarty_php();
while ($key + 1 < $cnt && ($this->subtrees[$key+1] instanceof _smarty_tag || $this->subtrees[$key +1]->data == '')) {
$key++;
if ($this->subtrees[$key]->data == '') {
continue;
}
$newCode = $this->subtrees[$key]->to_smarty_php();
if ((preg_match('/^\s*<\?php\s+/', $newCode) && preg_match('/\s*\?>\s*$/', $subtree))) {
$subtree = preg_replace('/\s*\?>\s*$/', "\n", $subtree);
$subtree .= preg_replace('/^\s*<\?php\s+/', '', $newCode);
} else {
$subtree .= $newCode;
}
}
if ($subtree == '') {
continue;
}
}
if (substr($code, - 1) == '<') {
$subtree = $this->subtrees[$key]->to_smarty_php();
if (substr($subtree, 0, 1) == '?') {
$code = substr($code, 0, strlen($code) - 1) . '<<?php ?>?' . substr($subtree, 1);
} elseif ($this->parser->asp_tags && substr($subtree, 0, 1) == '%') {
$code = substr($code, 0, strlen($code) - 1) . '<<?php ?>%' . substr($subtree, 1);
} else {
$code .= $subtree;
}
continue;
}
if ($this->parser->asp_tags && substr($code, - 1) == '%') {
$subtree = $this->subtrees[$key]->to_smarty_php();
if (substr($subtree, 0, 1) == '>') {
$code = substr($code, 0, strlen($code) - 1) . '%<?php ?>>' . substr($subtree, 1);
} else {
$code .= $subtree;
}
continue;
}
if (substr($code, - 1) == '?') {
$subtree = $this->subtrees[$key]->to_smarty_php();
if (substr($subtree, 0, 1) == '>') {
$code = substr($code, 0, strlen($code) - 1) . '?<?php ?>>' . substr($subtree, 1);
} else {
$code .= $subtree;
}
$code .= $subtree;
continue;
}
$code .= $this->subtrees[$key]->to_smarty_php();
}
return $code;
}
}
/**
@ -360,35 +359,3 @@ class _smarty_text extends _smarty_parsetree
return $this->data;
}
}
/**
* template linebreaks
*
* @package Smarty
* @subpackage Compiler
* @ignore
*/
class _smarty_linebreak extends _smarty_parsetree
{
/**
* Create buffer with linebreak content
*
* @param object $parser parser object
* @param string $data linebreak string
*/
public function __construct($parser, $data)
{
$this->parser = $parser;
$this->data = $data;
}
/**
* Return linebrak
*
* @return string linebreak
*/
public function to_smarty_php()
{
return $this->data;
}
}

View File

@ -231,6 +231,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase
// don't write cache file
return false;
}
$this->cached->timestamp = time();
$this->properties['cache_lifetime'] = $this->cache_lifetime;
$this->properties['unifunc'] = 'content_' . str_replace(array('.', ','), '_', uniqid('', true));
$content = $this->createTemplateCodeFrame($content, true);

View File

@ -245,7 +245,7 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data
// loop over items, stitch back together
foreach ($cache_split as $curr_idx => $curr_split) {
// escape PHP tags in template content
$output .= preg_replace('/(<%|%>|<\?php|<\?|\?>)/', "<?php echo '\$1'; ?>\n", $curr_split);
$output .= preg_replace('/(<%|%>|<\?php|<\?|\?>|<script\s+language\s*=\s*[\"\']?\s*php\s*[\"\']?\s*>)/', "<?php echo '\$1'; ?>\n", $curr_split);
if (isset($cache_parts[0][$curr_idx])) {
$_template->properties['has_nocache_code'] = true;
// remove nocache tags from cache output

View File

@ -23,6 +23,7 @@ class Smarty_Internal_Templatelexer
public $is_phpScript = false;
public $state = 1;
public $smarty;
public $literal_cnt = 0;
private $heredoc_id_stack = Array();
public $yyTraceFILE;
public $yyTracePrompt;
@ -164,12 +165,11 @@ class Smarty_Internal_Templatelexer
20 => 0,
21 => 0,
22 => 0,
23 => 0,
);
if ($this->counter >= strlen($this->data)) {
return false; // end of input
}
$yy_global_pattern = "/\G(\\{\\})|\G(" . $this->ldel . "\\*([\S\s]*?)\\*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*strip\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*\/strip\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*literal\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*(if|elseif|else if|while)\\s+)|\G(" . $this->ldel . "\\s*for\\s+)|\G(" . $this->ldel . "\\s*foreach(?![^\s]))|\G(" . $this->ldel . "\\s*setfilter\\s+)|\G(" . $this->ldel . "\\s*\/)|\G(" . $this->ldel . "\\s*)|\G((<script\\s+language\\s*=\\s*[\"']?\\s*php\\s*[\"']?\\s*>)|(<\\?(?:php\\w+|=|[a-zA-Z]+)?))|\G(\\?>)|\G(<\/script>)|\G(<\/script>)|\G(\\s*" . $this->rdel . ")|\G(<%)|\G(%>)|\G([\S\s])/iS";
$yy_global_pattern = "/\G(\\{\\})|\G(" . $this->ldel . "\\*([\S\s]*?)\\*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*strip\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*\/strip\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*literal\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*(if|elseif|else if|while)\\s+)|\G(" . $this->ldel . "\\s*for\\s+)|\G(" . $this->ldel . "\\s*foreach(?![^\s]))|\G(" . $this->ldel . "\\s*setfilter\\s+)|\G(" . $this->ldel . "\\s*\/)|\G(" . $this->ldel . "\\s*)|\G((<script\\s+language\\s*=\\s*[\"']?\\s*php\\s*[\"']?\\s*>)|(<\\?(?:php\\w+|=|[a-zA-Z]+)?))|\G(\\?>)|\G(<\/script>)|\G(\\s*" . $this->rdel . ")|\G(<%)|\G(%>)|\G([\S\s])/iS";
do {
if (preg_match($yy_global_pattern, $this->data, $yymatches, null, $this->counter)) {
@ -337,7 +337,7 @@ class Smarty_Internal_Templatelexer
function yy_r1_14($yy_subpatterns)
{
if (in_array($this->value, Array('<?', '<?=', '<?php')) || $script = strpos($this->value, '<s') === 0) {
if (($script = strpos($this->value, '<s') === 0) || in_array($this->value, Array('<?', '<?=', '<?php'))) {
if ($script) {
$this->is_phpScript = true;
}
@ -345,8 +345,8 @@ class Smarty_Internal_Templatelexer
} elseif ($this->value == '<?xml') {
$this->token = Smarty_Internal_Templateparser::TP_XMLTAG;
} else {
$this->token = Smarty_Internal_Templateparser::TP_FAKEPHPSTARTTAG;
$this->value = substr($this->value, 0, 2);
$this->token = Smarty_Internal_Templateparser::TP_TEXT;
//$this->value = substr($this->value, 0, 2);
}
}
@ -365,28 +365,22 @@ class Smarty_Internal_Templatelexer
function yy_r1_19($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_PHPENDSCRIPT;
$this->token = Smarty_Internal_Templateparser::TP_TEXT;
}
function yy_r1_20($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_TEXT;
$this->token = Smarty_Internal_Templateparser::TP_ASPSTARTTAG;
}
function yy_r1_21($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_ASPSTARTTAG;
}
function yy_r1_22($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_ASPENDTAG;
}
function yy_r1_23($yy_subpatterns)
function yy_r1_22($yy_subpatterns)
{
$phpEndScript = $this->is_phpScript ? '|<\\/script>' : '';
@ -962,19 +956,14 @@ class Smarty_Internal_Templatelexer
public function yylex3()
{
$tokenMap = array(
1 => 0,
2 => 0,
3 => 2,
6 => 0,
7 => 0,
8 => 0,
9 => 0,
10 => 0,
1 => 0,
2 => 0,
3 => 0,
);
if ($this->counter >= strlen($this->data)) {
return false; // end of input
}
$yy_global_pattern = "/\G(" . $this->ldel . "\\s*literal\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*\/literal\\s*" . $this->rdel . ")|\G((<script\\s+language\\s*=\\s*[\"']?\\s*php\\s*[\"']?\\s*>)|(<\\?(?:php\\w+|=|[a-zA-Z]+)?))|\G(\\?>)|\G(<\/script>)|\G(<%)|\G(%>)|\G([\S\s])/iS";
$yy_global_pattern = "/\G(" . $this->ldel . "\\s*literal\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*\/literal\\s*" . $this->rdel . ")|\G([\S\s])/iS";
do {
if (preg_match($yy_global_pattern, $this->data, $yymatches, null, $this->counter)) {
@ -1027,19 +1016,16 @@ class Smarty_Internal_Templatelexer
function yy_r3_1($yy_subpatterns)
{
if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
$this->token = Smarty_Internal_Templateparser::TP_TEXT;
} else {
$this->token = Smarty_Internal_Templateparser::TP_LITERALSTART;
$this->yypushstate(self::LITERAL);
}
$this->literal_cnt ++;
$this->token = Smarty_Internal_Templateparser::TP_LITERAL;
}
function yy_r3_2($yy_subpatterns)
{
if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
$this->token = Smarty_Internal_Templateparser::TP_TEXT;
if ($this->literal_cnt) {
$this->literal_cnt --;
$this->token = Smarty_Internal_Templateparser::TP_LITERAL;
} else {
$this->token = Smarty_Internal_Templateparser::TP_LITERALEND;
$this->yypopstate();
@ -1049,47 +1035,8 @@ class Smarty_Internal_Templatelexer
function yy_r3_3($yy_subpatterns)
{
if (in_array($this->value, Array('<?', '<?=', '<?php')) || $script = strpos($this->value, '<s') === 0) {
if ($script) {
$this->is_phpScript = true;
}
$this->token = Smarty_Internal_Templateparser::TP_PHPSTARTTAG;
} else {
$this->token = Smarty_Internal_Templateparser::TP_FAKEPHPSTARTTAG;
$this->value = substr($this->value, 0, 2);
}
}
function yy_r3_6($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_PHPENDTAG;
}
function yy_r3_7($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_PHPENDSCRIPT;
}
function yy_r3_8($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_ASPSTARTTAG;
}
function yy_r3_9($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_ASPENDTAG;
}
function yy_r3_10($yy_subpatterns)
{
$phpEndScript = $this->is_phpScript ? '|<\\/script>' : '';
$to = strlen($this->data);
preg_match("/{$this->ldel}\/?literal{$this->rdel}|<\?|<%|\?>|%>|<script\s+language\s*=\s*[\"\']?\s*php\s*[\"\']?\s*>{$phpEndScript}/", $this->data, $match, PREG_OFFSET_CAPTURE, $this->counter);
preg_match("/{$this->ldel}\/?literal{$this->rdel}/", $this->data, $match, PREG_OFFSET_CAPTURE, $this->counter);
if (isset($match[0][1])) {
$to = $match[0][1];
} else {
@ -1111,13 +1058,15 @@ class Smarty_Internal_Templatelexer
8 => 0,
9 => 0,
10 => 0,
11 => 3,
15 => 0,
11 => 0,
12 => 0,
13 => 3,
17 => 0,
);
if ($this->counter >= strlen($this->data)) {
return false; // end of input
}
$yy_global_pattern = "/\G(" . $this->ldel . "\\s*(if|elseif|else if|while)\\s+)|\G(" . $this->ldel . "\\s*for\\s+)|\G(" . $this->ldel . "\\s*foreach(?![^\s]))|\G(" . $this->ldel . "\\s*\/)|\G(" . $this->ldel . "\\s*)|\G(\")|\G(`\\$)|\G(\\$[0-9]*[a-zA-Z_]\\w*)|\G(\\$)|\G(([^\"\\\\]*?)((?:\\\\.[^\"\\\\]*?)*?)(?=(" . $this->ldel . "|\\$|`\\$|\")))|\G([\S\s])/iS";
$yy_global_pattern = "/\G(" . $this->ldel . "\\s*(if|elseif|else if|while)\\s+)|\G(" . $this->ldel . "\\s*for\\s+)|\G(" . $this->ldel . "\\s*foreach(?![^\s]))|\G(" . $this->ldel . "\\s*literal\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*\/literal\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*\/)|\G(" . $this->ldel . "\\s*)|\G(\")|\G(`\\$)|\G(\\$[0-9]*[a-zA-Z_]\\w*)|\G(\\$)|\G(([^\"\\\\]*?)((?:\\\\.[^\"\\\\]*?)*?)(?=(" . $this->ldel . "|\\$|`\\$|\")))|\G([\S\s])/iS";
do {
if (preg_match($yy_global_pattern, $this->data, $yymatches, null, $this->counter)) {
@ -1204,6 +1153,18 @@ class Smarty_Internal_Templatelexer
}
function yy_r4_5($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_TEXT;
}
function yy_r4_6($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_TEXT;
}
function yy_r4_7($yy_subpatterns)
{
if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
@ -1215,7 +1176,7 @@ class Smarty_Internal_Templatelexer
}
}
function yy_r4_6($yy_subpatterns)
function yy_r4_8($yy_subpatterns)
{
if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
@ -1227,14 +1188,14 @@ class Smarty_Internal_Templatelexer
}
}
function yy_r4_7($yy_subpatterns)
function yy_r4_9($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_QUOTE;
$this->yypopstate();
}
function yy_r4_8($yy_subpatterns)
function yy_r4_10($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_BACKTICK;
@ -1243,25 +1204,25 @@ class Smarty_Internal_Templatelexer
$this->taglineno = $this->line;
}
function yy_r4_9($yy_subpatterns)
function yy_r4_11($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_DOLLARID;
}
function yy_r4_10($yy_subpatterns)
function yy_r4_12($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_TEXT;
}
function yy_r4_11($yy_subpatterns)
function yy_r4_13($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_TEXT;
}
function yy_r4_15($yy_subpatterns)
function yy_r4_17($yy_subpatterns)
{
$to = strlen($this->data);

View File

@ -1,9 +1,9 @@
#
Version 2.0-beta4 / RC? ()
Version 2.0-beta4/5 / RC? ()
------------------------------------------------------------------------
* Smarty 3.1.20 upgrade (see changelog)
* Smarty 3.1.21 upgrade (see changelog)
* Fix issue #220 with pdf directory moving rename() error