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: http://svn.automattic.com/wordpress/trunk@20311 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
a95f3d243a
commit
3a722f41d7
|
@ -896,10 +896,11 @@ class ftp_base {
|
|||
}
|
||||
}
|
||||
|
||||
$mod_sockets=TRUE;
|
||||
if (!extension_loaded('sockets')) {
|
||||
$mod_sockets = extension_loaded( 'sockets' );
|
||||
if ( ! $mod_sockets && function_exists( 'dl' ) && is_callable( 'dl' ) ) {
|
||||
$prefix = ( PHP_SHLIB_SUFFIX == 'dll' ) ? 'php_' : '';
|
||||
if(!@dl($prefix . 'sockets.' . PHP_SHLIB_SUFFIX)) $mod_sockets=FALSE;
|
||||
@dl( $prefix . 'sockets.' . PHP_SHLIB_SUFFIX );
|
||||
$mod_sockets = extension_loaded( 'sockets' );
|
||||
}
|
||||
|
||||
require_once "class-ftp-" . ( $mod_sockets ? "sockets" : "pure" ) . ".php";
|
||||
|
|
Loading…
Reference in New Issue