Skip to content

Commit

Permalink
Add requirement for mbstring extension to be loaded for QR code to work
Browse files Browse the repository at this point in the history
  • Loading branch information
campbell-m committed Jul 17, 2024
1 parent c8523f3 commit 63a8e53
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions web/Themes/default/header.inc
Original file line number Diff line number Diff line change
Expand Up @@ -471,10 +471,12 @@ function print_banner(?array $context, $simple=false, $omit_login=false) : void
echo "</nav>\n";

// Add in a QR code for kiosk mode
// (The QR code library requires PHP 7.4 or greater)
// (The QR code library requires PHP 7.4 or greater and the mbstring extension)
if (isset($context['kiosk']) &&
$kiosk_QR_code &&
(version_compare(PHP_VERSION, '7.4') >= 0))
(version_compare(PHP_VERSION, '7.4') >= 0) &&
//Check for a Mbstring constant rather than using extension_loaded, which is sometimes disabled
defined('MB_CASE_UPPER'))
{
$url = multisite(url_base() . "/index.php?$query");
echo '<nav class="qr" title="' . htmlspecialchars($url) . "\">\n";
Expand Down
2 changes: 1 addition & 1 deletion web/systemdefaults.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@
$kiosk_default_mode = 'room';

// Whether to show a QR code in kiosk mode
// Note that PHP 7.4 or greater is required for a QR code
// Note that PHP 7.4 or greater and the mbstring extension are required for a QR code
$kiosk_QR_code = true;

// Timeout if the exit kiosk mode dialog is not acted upon
Expand Down

0 comments on commit 63a8e53

Please sign in to comment.