mirror of
git://develop.git.wordpress.org/
synced 2025-01-17 21:08:44 +01:00
WP_Filesystem: PemFTP: Detect dl() being disabled in order to avoid any fatals which may be produced when the Sockets extension is not available. Props to kurtpayne for initial patch, Fixes #20187
git-svn-id: https://develop.svn.wordpress.org/trunk@20311 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
eeee02b520
commit
c024ae710c
@ -896,11 +896,12 @@ class ftp_base {
|
||||
}
|
||||
}
|
||||
|
||||
$mod_sockets=TRUE;
|
||||
if (!extension_loaded('sockets')) {
|
||||
$prefix = (PHP_SHLIB_SUFFIX == 'dll') ? 'php_' : '';
|
||||
if(!@dl($prefix . 'sockets.' . PHP_SHLIB_SUFFIX)) $mod_sockets=FALSE;
|
||||
$mod_sockets = extension_loaded( 'sockets' );
|
||||
if ( ! $mod_sockets && function_exists( 'dl' ) && is_callable( 'dl' ) ) {
|
||||
$prefix = ( PHP_SHLIB_SUFFIX == 'dll' ) ? 'php_' : '';
|
||||
@dl( $prefix . 'sockets.' . PHP_SHLIB_SUFFIX );
|
||||
$mod_sockets = extension_loaded( 'sockets' );
|
||||
}
|
||||
|
||||
require_once "class-ftp-".($mod_sockets?"sockets":"pure").".php";
|
||||
require_once "class-ftp-" . ( $mod_sockets ? "sockets" : "pure" ) . ".php";
|
||||
?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user