Unverified Commit b129d5d2 authored by Thomas Müller's avatar Thomas Müller
Browse files

Fixing php 7.1 Error: [] operator not supported for strings

parent 2486c1ab
......@@ -60,7 +60,7 @@ class SecuritySettingsController extends Controller {
* @return array
*/
public function trustedDomains($newTrustedDomain) {
$trustedDomains = $this->config->getSystemValue('trusted_domains');
$trustedDomains = $this->config->getSystemValue('trusted_domains', []);
$trustedDomains[] = $newTrustedDomain;
$this->config->setSystemValue('trusted_domains', $trustedDomains);
......
......@@ -58,7 +58,7 @@ class SecuritySettingsControllerTest extends \PHPUnit_Framework_TestCase {
->expects($this->once())
->method('getSystemValue')
->with('trusted_domains')
->will($this->returnValue(''));
->will($this->returnValue([]));
$response = $this->securitySettingsController->trustedDomains('newdomain.com');
$expectedResponse = ['status' => 'success'];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment