Browse Source

If there is no UID do not explode accessibility javascript

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
tags/v15.0.0beta1
Roeland Jago Douma 5 years ago
parent
commit
3ac15a45ea
No account linked to committer's email address
1 changed files with 9 additions and 1 deletions
  1. 9
    1
      apps/accessibility/lib/Controller/AccessibilityController.php

+ 9
- 1
apps/accessibility/lib/Controller/AccessibilityController.php View File

@@ -192,9 +192,17 @@ class AccessibilityController extends Controller {
* @return DataDownloadResponse
*/
public function getJavascript(): DataDownloadResponse {
$user = $this->userSession->getUser();

if ($user === null) {
$theme = false;
} else {
$theme = $this->config->getUserValue($user->getUID(), $this->appName, 'theme', false);
}

$responseJS = '(function() {
OCA.Accessibility = {
theme: ' . json_encode($this->config->getUserValue($this->userSession->getUser()->getUID(), $this->appName, 'theme', false)) . ',
theme: ' . json_encode($theme) . ',
};
})();';

Loading…
Cancel
Save