#34496 [Opn->Fbk]: single quote copying files

From: Date: Wed, 14 Sep 2005 06:14:24 +0000
Subject: #34496 [Opn->Fbk]: single quote copying files
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-85009@lists.php.net to get a copy of this message
ID: 34496 Updated by: sniper@php.net Reported By: before_after_death at yahoo dot com -Status: Open +Status: Feedback Bug Type: *Directory/Filesystem functions Operating System: WINDOWS XP -PHP Version: 5.0.5 +PHP Version: 5.0.4 New Comment: Please try using this CVS snapshot: http://snaps.php.net/php5-latest.tar.gz For Windows: http://snaps.php.net/win32/php5-win32-latest.zip Previous Comments: ------------------------------------------------------------------------ [2005-09-14 04:54:17] before_after_death at yahoo dot com Description: ------------ There's bug that I found in PHP5.0.4 (I'm sorry if the problem has been fixed) This is the problem: for example: the $uploadfile=bring'iton.jpg and the result: iton.jpg it doesn't happen at PHP4 version, so I remigrate to PHP4 again. Reproduce code: --------------- <? include "connect.config.php"; $cwdvar=getcwd(); $cwdvar1=str_replace("\\","/",$cwdvar); $file_name = "$uploadFile_name"; echo "$uploadFile_name"; $file_name=str_replace("'","",$file_name); $copy = copy($uploadFile,$file_name); if($copy){ echo "<b>$file_name </b> upload succeed<br>"; $query_insert="INSERT INTO dirfiles (filename, dirpath) VALUES ('$file_name', '$cwdvar1')"; $query_res=mysql_query("$query_insert"); if($query_res){ echo "database updated"; } }else{ echo "<b>$file_name</b> database doesn't updated<br>"; } ?> Expected result: ---------------- i expect the result is bringiton.jpg (because there's an str_replace function) and I try to remigrate to PHP4, the result is bringiton.jpg Actual result: -------------- The result is iton.jpg (at PHP 5.0.4) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=34496&edit=1

« previous php.bugs (#85009) next »