php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31723 call function_exists in safe_mod return true to set_time_limit
Submitted: 2005-01-27 15:32 UTC Modified: 2005-01-27 18:05 UTC
From: diogo at netmake dot com dot br Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 4.3.10 OS: Any System
Private report: No CVE-ID: None
 [2005-01-27 15:32 UTC] diogo at netmake dot com dot br
Description:
------------
I'm doing a multiplataform software. I always need to set set_time_limit(0), but some unix disable then turning on safe_mode. in safe_mode, some functions and functionales are disabled. how can call function_exists("set_time_limit") to test if always i get TRUE? in safe_mode should be false. The same happens with get_defined_functions, that returns an array with set_time_limit seted TRUE.

Reproduce code:
---------------
$bol_result = function_exists("set_time_limit");
if($bol_result)
{
	set_time_limit(0);
}

Expected result:
----------------
$bol_result return false

Actual result:
--------------
$bol_result returns true, then call set_time_limit, my php is in safe_mode so crash:
set_time_limit(): Cannot set time limit in safe mode

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-27 17:40 UTC] iliaa@php.net
The function exists, which is why the return value of function_exists is TRUE.
 [2005-01-27 17:40 UTC] sesser@php.net
The function still exists in safe_mode it is just not allowed. You have to check if safe_mode is enabled or not instead.

 [2005-01-27 18:05 UTC] derick@php.net
Actually, you can use it in safe-mode... to lower the limit (AFAIK).
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 17 10:01:30 2025 UTC