Bug #73921 [Opn->Sus]: disable_functions should result in fatal error

From: Date: Fri, 13 Jan 2017 15:15:00 +0000
Subject: Bug #73921 [Opn->Sus]: disable_functions should result in fatal error
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-206600@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73921&edit=1 ID: 73921 Updated by: cmb@php.net Reported by: spam2 at rhsoft dot net Summary: disable_functions should result in fatal error -Status: Open +Status: Suspended Type: Bug Package: Scripting Engine problem PHP Version: 7.1.0 Block user comment: N Private report: N New Comment: Disabling a function isn't the same as undefining it (or never have it being defined, for that matter), as can be seen from get_defined_functions() which also returns disabled functions (by default). Therefore I don't think this qualifies as a bug, but is rather a feature request. However, changing the behavior could cause massive BC break, so this would appear to require the RFC process[1]. Thus I'm suspending this ticket, until someone comes up with an RFC. BTW: the example you're presenting isn't a particular good one, as it would return FALSE regardless of whether disabling popen() would throw an exception or not. > BUT you can't try-catch warnings That's not necessarily correct, see <http://php.net/manual/en/class.errorexception.php#errorexception.examples>. [1] <https://wiki.php.net/rfc/howto> Previous Comments: ------------------------------------------------------------------------ [2017-01-12 13:10:05] spam2 at rhsoft dot net Description: ------------ PHP Warning: popen() has been disabled for security reasons sorry, but that is nonsense because from the view of the script it make sno difference if a function can't be called becaus ea typo or because it is disabled and so completly legit code for optional features don't work BUT you can't try-catch warnings private function syslog(string $message) { global $cms_syslog; /** Je nach Serverkonfiguration nicht vorhanden */ try { /** Usernamen hinzufuegen wenn angemeldet */ if(!empty($_SESSION[CMS_HOST_HASH . '_auth_uname'])) { $message .= " ({$_SESSION[CMS_HOST_HASH . '_auth_uname']})"; } /** Sonderzeichen filtern */ $message = strip_tags($this->escape_logitem($message)); /** Kommando mittels "popen" ausfuehren und Rueckgabe in Variable schreiben */ if($fp = popen($cms_syslog . ' ' . escapeshellarg($message) , 'r')) { pclose($fp); return true; } else { return false; } } catch(Error $e) { return false; } } ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=73921&edit=1

« previous php.bugs (#206600) next »