Skip to content

Commit

Permalink
Errors: sanitize output (#2820)
Browse files Browse the repository at this point in the history
  • Loading branch information
dasgarner authored Dec 2, 2024
1 parent 54b15fc commit 035bf6a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/Factory/MediaFactory.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/*
* Copyright (C) 2023 Xibo Signage Ltd
* Copyright (C) 2024 Xibo Signage Ltd
*
* Xibo - Digital Signage - https://xibosignage.com
*
Expand Down Expand Up @@ -183,7 +183,7 @@ public function queueDownload($name, $uri, $expiry, $requestOptions = [])
$media->enableStat = $requestOptions['enableStat'];
$media->folderId = $requestOptions['folderId'];
$media->permissionsFolderId = $requestOptions['permissionsFolderId'];
$media->apiRef = $requestOptions['apiRef'];
$media->apiRef = $requestOptions['apiRef'] ?? null;
}

$this->getLog()->debug('Queue download of: ' . $uri . ', current mediaId for this download is '
Expand Down
6 changes: 3 additions & 3 deletions lib/Middleware/Handlers.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/*
* Copyright (C) 2023 Xibo Signage Ltd
* Copyright (C) 2024 Xibo Signage Ltd
*
* Xibo - Digital Signage - http://www.xibo.org.uk
* Xibo - Digital Signage - https://xibosignage.com
*
* This file is part of Xibo.
*
Expand Down Expand Up @@ -151,7 +151,7 @@ public static function webErrorHandler($container)
} else {
// Make a friendly message
if ($displayErrorDetails || $exception instanceof GeneralException) {
$message = $exception->getMessage();
$message = htmlspecialchars($exception->getMessage());
} else {
$message = __('Unexpected Error, please contact support.');
}
Expand Down

0 comments on commit 035bf6a

Please sign in to comment.