Changeset 52996
- Timestamp:
- 03/26/2022 03:26:15 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-ftp.php
r52978 r52996 793 793 } 794 794 795 function glob_pattern_match($pattern,$s tring) {795 function glob_pattern_match($pattern,$subject) { 796 796 $out=null; 797 797 $chunks=explode(';',$pattern); … … 808 808 $out[]=$pattern; 809 809 } 810 if(count($out)==1) return($this->glob_regexp("^$out[0]$",$s tring));810 if(count($out)==1) return($this->glob_regexp("^$out[0]$",$subject)); 811 811 else { 812 812 foreach($out as $tester) 813 if($this->my_regexp("^$tester$",$string)) return true; 813 // TODO: This should probably be glob_regexp(), but needs tests. 814 if($this->my_regexp("^$tester$",$subject)) return true; 814 815 } 815 816 return false; 816 817 } 817 818 818 function glob_regexp($pattern,$ probe) {819 function glob_regexp($pattern,$subject) { 819 820 $sensitive=(PHP_OS!='WIN32'); 820 821 return ($sensitive? 821 preg_match( '/' . preg_quote( $pattern, '/' ) . '/', $ probe) :822 preg_match( '/' . preg_quote( $pattern, '/' ) . '/i', $ probe)822 preg_match( '/' . preg_quote( $pattern, '/' ) . '/', $subject ) : 823 preg_match( '/' . preg_quote( $pattern, '/' ) . '/i', $subject ) 823 824 ); 824 825 }
Note: See TracChangeset
for help on using the changeset viewer.