Update Socket.php

pull/100/head
Dennis1993 11 years ago
parent e950546903
commit d52a77a10d

@ -672,10 +672,15 @@ class Net_Socket extends PEAR
*/
function enableCrypto($enabled, $type)
{
if (!is_resource($this->fp)) {
return $this->raiseError('not connected');
if (version_compare(phpversion(), "5.1.0", ">=")) {
if (!is_resource($this->fp)) {
return $this->raiseError('not connected');
}
return @stream_socket_enable_crypto($this->fp, $enabled, $type);
} else {
$msg = 'Net_Socket::enableCrypto() requires php version >= 5.1.0';
return $this->raiseError($msg);
}
return @stream_socket_enable_crypto($this->fp, $enabled, $type);
}
}

Loading…
Cancel
Save