0

I were not able to find a proper source stating what the intended behaviour is when invoking a function listed in disable_functions.

My observation is that a log entry is created saying something like

[04-Sep-2014 16:17:55 UTC] PHP Warning: curl_exec() has been disabled for security reasons in {file} {line}

But what does the function return in such a case? And I mean what is it documented to return?

AbraCadaver
  • 78,200
  • 7
  • 66
  • 87
Adrian Föder
  • 770
  • 1
  • 7
  • 22

2 Answers2

1

This functionality is not formally documented, but if you look at the source, PHP has a placeholder function that gets called instead of a disabled function. This placeholder function only generates the warning and does not explicitly return any value. This "lack of a return value" is translated to a NULL before your PHP code sees it.

DCoder
  • 12,962
  • 4
  • 40
  • 62
0

I haven't seen it documented, but it returns NULL. With disable_functions = file_get_contents:

var_dump(file_get_contents(__FILE__));

Warning: file_get_contents() has been disabled for security reasons in test.php on line 2

NULL

Same results with curl_exec.

AbraCadaver
  • 78,200
  • 7
  • 66
  • 87