From 2d8e5e0d95428b5f31238b651277788bd5d43584 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 16 Jan 2020 12:38:40 +0100 Subject: [sysconfig] No byte-array packing, escape ini --- .../sysconfig/inc/configmodule/screensaver.inc.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/modules-available/sysconfig/inc/configmodule/screensaver.inc.php b/modules-available/sysconfig/inc/configmodule/screensaver.inc.php index 813b040d..60687fac 100644 --- a/modules-available/sysconfig/inc/configmodule/screensaver.inc.php +++ b/modules-available/sysconfig/inc/configmodule/screensaver.inc.php @@ -73,29 +73,29 @@ class ConfigModule_Screensaver extends ConfigModule private function getFileArray() { $files = array( - '/opt/openslx/xscreensaver/style.qss' => array_values(unpack('C*', $this->moduleData['qss'])), - '/opt/openslx/xscreensaver/text-idle-kill' => array_values(unpack('C*', $this->wrapHtmlTags('text-idle-kill'))), - '/opt/openslx/xscreensaver/text-no-timeout' => array_values(unpack('C*', $this->wrapHtmlTags('text-no-timeout'))), - '/opt/openslx/xscreensaver/text-shutdown' => array_values(unpack('C*', $this->wrapHtmlTags('text-shutdown'))), + '/opt/openslx/xscreensaver/style.qss' => $this->moduleData['qss'], + '/opt/openslx/xscreensaver/text-idle-kill' => $this->wrapHtmlTags('text-idle-kill'), + '/opt/openslx/xscreensaver/text-no-timeout' => $this->wrapHtmlTags('text-no-timeout'), + '/opt/openslx/xscreensaver/text-shutdown' => $this->wrapHtmlTags('text-shutdown'), ); /* Create the message.ini from the messages array */ $messages = ''; - foreach ($this->moduleData['messages'] as $categorie => $array) { - $messages = $messages . '[' . $categorie . ']' . "\n"; + foreach ($this->moduleData['messages'] as $category => $array) { + $messages .= '[' . $category . ']' . "\n"; foreach ($array as $key => $message) { - $messages = $messages . $key . '="' . $message . '"' . "\n"; + $messages .= $key . '="' . str_replace(['\\', '"', "\n", "\r"], '-', $message) . '"' . "\n"; } } - $files['/opt/openslx/xscreensaver/messages.ini'] = array_values(unpack('C*', $messages)); + $files['/opt/openslx/xscreensaver/messages.ini'] = $messages; /* Add locked files if there are any */ if (isset($this->moduleData['texts']['text-idle-kill-locked'])) - $files['/opt/openslx/xscreensaver/text-idle-kill-locked'] = array_values(unpack('C*', $this->wrapHtmlTags('text-idle-kill-locked'))); + $files['/opt/openslx/xscreensaver/text-idle-kill-locked'] = $this->wrapHtmlTags('text-idle-kill-locked'); if (isset($this->moduleData['texts']['text-no-timeout-locked'])) - $files['/opt/openslx/xscreensaver/text-no-timeout-locked'] = array_values(unpack('C*', $this->wrapHtmlTags('text-no-timeout-locked'))); + $files['/opt/openslx/xscreensaver/text-no-timeout-locked'] = $this->wrapHtmlTags('text-no-timeout-locked'); if (isset($this->moduleData['texts']['text-shutdown-locked'])) - $files['/opt/openslx/xscreensaver/text-shutdown-locked'] = array_values(unpack('C*', $this->wrapHtmlTags('text-shutdown-locked'))); + $files['/opt/openslx/xscreensaver/text-shutdown-locked'] = $this->wrapHtmlTags('text-shutdown-locked'); return $files; } -- cgit v1.2.3-55-g7522