Skip to content

Commit

Permalink
Show WARNING when open_basedir and realpath_turbo.open_basedir are se…
Browse files Browse the repository at this point in the history
…t together

If open_basedir is set when realpath_turbo should be used it doesn't make sense
because then realpath cache is already disabled by PHP and cannot be re-enabled.
  • Loading branch information
Whissi committed Oct 6, 2016
1 parent a62d844 commit b3be040
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions realpath_turbo.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ PHP_RINIT_FUNCTION(realpath_turbo)
#endif

if (rpt_open_basedir && *rpt_open_basedir) {
if (PG(open_basedir) && *PG(open_basedir)) {
php_error_docref(NULL, E_WARNING, "open_basedir already set! Please unset open_basedir and only use realpath_turbo.open_basedir option. realpath_turbo will not have any effect when open_basedir is already set.");
return FAILURE;
}
#if PHP_MAJOR_VERSION < 7
zend_alter_ini_entry("open_basedir", sizeof("open_basedir"), rpt_open_basedir, strlen(rpt_open_basedir), PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE);
#else
Expand Down

0 comments on commit b3be040

Please sign in to comment.