fckphp_config=$fckphp_config; $this->type=$type; $this->raw_cwd=$cwd; $this->actual_cwd=str_replace("//","/",($fckphp_config['UserFilesPath']."/$type/".$this->raw_cwd)); $this->real_cwd=str_replace("//","/",($this->fckphp_config['basedir']."/".$this->actual_cwd)); $this->filename=str_replace(array("..","/"),"",$_GET['FileName']); $this->newname=str_replace(array("..","/"),"",$this->checkName($_GET['NewName'])); } function checkName($name) { $newName=""; for ($i=0;$ifckphp_config['FileNameAllowedChars'])) $newName.=$name[$i]; } return $newName; } function run() { $result1=false; $result2=true; if ($this->newname!='') { if ($this->nameValid($this->newname)) { //Remove thumbnail if it exists $result2=true; $thumb=$this->real_cwd.'/.thumb_'.$this->filename; if (file_exists($thumb)) $result2=unlink($thumb); $result1=rename($this->real_cwd.'/'.$this->filename,$this->real_cwd.'/'.$this->newname); } else { $result1=false; } } header ("content-type: text/xml"); echo "\n"; ?> " /> fckphp_config['ResourceAreas'][$this->type]; $lastdot=strrpos($fname,"."); if ($lastdot!==false) { $ext=substr($fname,($lastdot+1)); $fname=substr($fname,0,$lastdot); if (in_array(strtolower($ext),$type_config['AllowedExtensions'])) { return true; } else { return false; } } } } ?>