From 401f60d576e91d5ad9441b0a72a52f234b326ce6 Mon Sep 17 00:00:00 2001 From: David Monllao Date: Mon, 15 Jul 2013 11:22:49 +0200 Subject: [PATCH] MDL-39441 behat: New setting to expand the list of allowed settings --- config-dist.php | 5 +++++ lib/behat/lib.php | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/config-dist.php b/config-dist.php index e22d246d37d..640b4480fd9 100644 --- a/config-dist.php +++ b/config-dist.php @@ -631,6 +631,11 @@ $CFG->admin = 'admin'; // Example: // $CFG->behat_restart_browser_after = 7200; // Restarts the browser session after 2 hours // +// All this page's extra Moodle settings are compared against a white list of allowed settings +// (the basic and behat_* ones) to avoid problems with production environments. This setting can be +// used to expand the default white list with an array of extra settings. +// Example: +// $CFG->behat_extraallowedsettings = array('logsql', 'dblogerror'); //========================================================================= // ALL DONE! To continue installation, visit your main page with a browser diff --git a/lib/behat/lib.php b/lib/behat/lib.php index aa6668597dd..559821ee5b2 100644 --- a/lib/behat/lib.php +++ b/lib/behat/lib.php @@ -160,6 +160,11 @@ function behat_clean_init_config() { 'theme' )); + // Add extra allowed settings. + if (!empty($CFG->behat_extraallowedsettings)) { + $allowed = array_merge($allowed, array_flip($CFG->behat_extraallowedsettings)); + } + // Also allowing behat_ prefixed attributes. foreach ($CFG as $key => $value) { if (!isset($allowed[$key]) && strpos($key, 'behat_') !== 0) {