wp/wp-admin/includes/class-ftp.php
changeset 21 48c4eec2b7e6
parent 19 3d72ae0968f4
child 22 8c2e4d02f4ef
equal deleted inserted replaced
20:7b1b88e27a20 21:48c4eec2b7e6
   481 		}
   481 		}
   482 		if($this->_curtype!=FTP_BINARY) {
   482 		if($this->_curtype!=FTP_BINARY) {
   483 			$this->PushError("restore", "cannot restore in ASCII mode");
   483 			$this->PushError("restore", "cannot restore in ASCII mode");
   484 			return FALSE;
   484 			return FALSE;
   485 		}
   485 		}
   486 		if(!$this->_exec("REST ".$from, "resore")) return FALSE;
   486 		if(!$this->_exec("REST ".$from, "restore")) return FALSE;
   487 		if(!$this->_checkCode()) return FALSE;
   487 		if(!$this->_checkCode()) return FALSE;
   488 		return TRUE;
   488 		return TRUE;
   489 	}
   489 	}
   490 
   490 
   491 	function features() {
   491 	function features() {
   795 	function glob_pattern_match($pattern,$subject) {
   795 	function glob_pattern_match($pattern,$subject) {
   796 		$out=null;
   796 		$out=null;
   797 		$chunks=explode(';',$pattern);
   797 		$chunks=explode(';',$pattern);
   798 		foreach($chunks as $pattern) {
   798 		foreach($chunks as $pattern) {
   799 			$escape=array('$','^','.','{','}','(',')','[',']','|');
   799 			$escape=array('$','^','.','{','}','(',')','[',']','|');
   800 			while(strpos($pattern,'**')!==false)
   800 			while(str_contains($pattern,'**'))
   801 				$pattern=str_replace('**','*',$pattern);
   801 				$pattern=str_replace('**','*',$pattern);
   802 			foreach($escape as $probe)
   802 			foreach($escape as $probe)
   803 				$pattern=str_replace($probe,"\\$probe",$pattern);
   803 				$pattern=str_replace($probe,"\\$probe",$pattern);
   804 			$pattern=str_replace('?*','*',
   804 			$pattern=str_replace('?*','*',
   805 				str_replace('*?','*',
   805 				str_replace('*?','*',