diff --git a/control/Controller.php b/control/Controller.php index f39e8a14d..3f4f92dda 100644 --- a/control/Controller.php +++ b/control/Controller.php @@ -368,6 +368,10 @@ class Controller extends RequestHandler { */ function can($perm, $member = null) { if(!$member) $member = Member::currentUser(); + if(is_array($perm)) { + $perm = array_map(array($this, 'can'), $perm, array_fill(0, count($perm), $member)); + return min($perm); + } if($this->hasMethod($methodName = 'can' . $perm)) { return $this->$methodName($member); } else { diff --git a/core/Core.php b/core/Core.php index de6054961..13c355829 100644 --- a/core/Core.php +++ b/core/Core.php @@ -40,7 +40,7 @@ /////////////////////////////////////////////////////////////////////////////// // ENVIRONMENT CONFIG -if(defined('E_DEPRECATED')) error_reporting(E_ALL ^ E_DEPRECATED); +if(defined('E_DEPRECATED')) error_reporting(E_ALL & ~(E_DEPRECATED | E_STRICT)); else error_reporting(E_ALL); /* * This is for versions of PHP prior to version 5.2 diff --git a/dev/Backtrace.php b/dev/Backtrace.php index ffb0c5f55..186641ead 100644 --- a/dev/Backtrace.php +++ b/dev/Backtrace.php @@ -136,7 +136,8 @@ class SS_Backtrace { $args = array(); foreach($item['args'] as $arg) { if(!is_object($arg) || method_exists($arg, '__toString')) { - $args[] = (strlen((string)$arg) > $argCharLimit) ? substr((string)$arg, 0, $argCharLimit) . '...' : (string)$arg; + $sarg = is_array($arg) ? 'Array' : strval($arg); + $args[] = (strlen($sarg) > $argCharLimit) ? substr($sarg, 0, $argCharLimit) . '...' : $sarg; } else { $args[] = get_class($arg); } diff --git a/main.php b/main.php index 60bed156f..b99426088 100644 --- a/main.php +++ b/main.php @@ -107,6 +107,9 @@ require_once("model/DB.php"); // Redirect to the installer if no database is selected if(!isset($databaseConfig) || !isset($databaseConfig['database']) || !$databaseConfig['database']) { + if(!file_exists(BASE_PATH . '/install.php')) { + die('SilverStripe Framework requires a $databaseConfig defined.'); + } $s = (isset($_SERVER['SSL']) || (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off')) ? 's' : ''; $installURL = "http$s://" . $_SERVER['HTTP_HOST'] . BASE_URL . '/install.php'; diff --git a/tests/api/RestfulServiceTest.php b/tests/api/RestfulServiceTest.php index ae7b6f728..8fc5bfe15 100644 --- a/tests/api/RestfulServiceTest.php +++ b/tests/api/RestfulServiceTest.php @@ -218,7 +218,7 @@ class RestfulServiceTest_MockRestfulService extends RestfulService { public $session = null; - public function request($subURL = '', $method = "GET", $data = null, $headers = null) { + public function request($subURL = '', $method = "GET", $data = null, $headers = null, $curlOptions = array()) { if(!$this->session) { $this->session = new Session(array()); @@ -277,7 +277,7 @@ class RestfulServiceTest_MockRestfulService extends RestfulService { */ class RestfulServiceTest_MockErrorService extends RestfulService { - public function curlRequest() { + public function curlRequest($url, $method, $data = null, $headers = null, $curlOptions = array()) { return new RestfulService_Response('HTTP Error', 400); } diff --git a/view/SSViewer.php b/view/SSViewer.php index 1e43c9b1d..7de22b792 100644 --- a/view/SSViewer.php +++ b/view/SSViewer.php @@ -319,7 +319,7 @@ class SSViewer { } } - if(substr((string) $templateList,-3) == '.ss') { + if(!is_array($templateList) && substr((string) $templateList,-3) == '.ss') { $this->chosenTemplates['main'] = $templateList; } else { $this->chosenTemplates = SS_TemplateLoader::instance()->findTemplates(