|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-08-12 22:39 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 05:00:01 2025 UTC |
Description: ------------ When I ran a script it chopped the "\" plus the first letter of a directory when processing some copy commands. I looked at the script, and I think maybe the problem had something to do with the "explode" function. I apologize for not being able to be more certain of this, but I am not a coder. Reproduce code: --------------- // create dirs for processing the file (server) if ( $this->move_method == 'copy') { $dir_path = '' ; $splitarray = explode('/', $copy_path) ; for ($idir=0; $idir<count($splitarray); $idir++) { $dir_path .= trim($splitarray[$idir]) ; // don't bother making ../ ;-) if ($splitarray[$idir] == '..') { // do nothing } else if (!file_exists($dir_path)) { // use the mkdir command mkdir($dir_path, 0777); chmod($dir_path, 0777); } $dir_path .= '/' ; } } Expected result: ---------------- It is supposed to copy a file from "directoryX" to "directoryY\newlocation". Actual result: -------------- An error because it actually tries to copy the file from "directoryX" to "directoryYewlocation".