FTP: ensure that there is only one class named ftp, which is what is expected in the loading of this arcane library. This ensures that an autoload generator, something along the lines of Composer, won't hiccup when it gets to these files.

See #36335.


git-svn-id: https://develop.svn.wordpress.org/trunk@38380 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor
2016-08-26 18:46:17 +00:00
parent a581574b3a
commit 8b431f6859
3 changed files with 9 additions and 11 deletions
+7 -1
View File
@@ -818,7 +818,7 @@ class ftp_base {
function glob_regexp($pattern,$probe) {
$sensitive=(PHP_OS!='WIN32');
return ($sensitive?
preg_match( '/' . preg_quote( $pattern, '/' ) . '/', $probe ) :
preg_match( '/' . preg_quote( $pattern, '/' ) . '/', $probe ) :
preg_match( '/' . preg_quote( $pattern, '/' ) . '/i', $probe )
);
}
@@ -904,3 +904,9 @@ if ( ! $mod_sockets && function_exists( 'dl' ) && is_callable( 'dl' ) ) {
}
require_once dirname( __FILE__ ) . "/class-ftp-" . ( $mod_sockets ? "sockets" : "pure" ) . ".php";
if ( $mod_sockets ) {
class ftp extends ftp_sockets {}
} else {
class ftp extends ftp_pure {}
}