php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #66729 Introduce a means to test if a function has been disabled via disable_functions
Submitted: 2014-02-17 21:23 UTC Modified: 2014-02-17 23:58 UTC
From: johnbillion+php at gmail dot com Assigned:
Status: Wont fix Package: *Configuration Issues
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: johnbillion+php at gmail dot com
New email:
PHP Version: OS:

 

 [2014-02-17 21:23 UTC] johnbillion+php at gmail dot com
Description:
------------
Feature request.

It is possible to disable PHP functions via the `disable_functions` directive in php.ini. However, there is no method of testing, at runtime, whether a given function has been disabled by this means,

The common way to detect whether a function has been disabled is to inspect the return value of `ini_get('disable_functions')`. This is far from optimal, especially if `ini_get()` itself has been disabled.

A function should be introduced which accepts a function name and returns a boolean value stating whether the function has been disabled. Example:

`if ( ! function_disabled('exec') ) { exec( $command ) }`

Alternatively, to avoid the double negative, it could be named something like `function_enabled()` or `function_available()`.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-02-17 23:58 UTC] requinix@php.net
-Status: Open +Status: Wont fix
 [2014-02-17 23:58 UTC] requinix@php.net
function_exists() does that.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 07:01:31 2024 UTC