From 447e70b63345d6dfc4bf1ff303b9c1fc7ada2846 Mon Sep 17 00:00:00 2001 From: FrancisTicgal Date: Thu, 13 Nov 2025 13:51:50 +0100 Subject: [PATCH 1/5] add codesniffer bin --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index a5ca0a4..064ce33 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,8 @@ "php-parallel-lint/php-parallel-lint": "^1.4", "phpstan/extension-installer": "^1.4", "phpstan/phpstan": "^2.1", - "phpstan/phpstan-deprecation-rules": "^2.0" + "phpstan/phpstan-deprecation-rules": "^2.0", + "squizlabs/php_codesniffer": "^3.7" }, "config": { "optimize-autoloader": true, From 49aef45f8873992145915904ae6877fd5cc9fec1 Mon Sep 17 00:00:00 2001 From: maria Date: Fri, 14 Nov 2025 12:34:31 +0100 Subject: [PATCH 2/5] glpi11 --- ajax/planning.php | 9 ++++++--- inc/calendar.class.php | 25 +++++++++++++------------ setup.php | 1 + tools/migrate_accounts.php | 18 ++++++++++++------ 4 files changed, 32 insertions(+), 21 deletions(-) diff --git a/ajax/planning.php b/ajax/planning.php index 4f66a09..dcbef31 100644 --- a/ajax/planning.php +++ b/ajax/planning.php @@ -42,7 +42,11 @@ exit; } -global $DB, $CFG_GLPI; +/** @var array $CFG_GLPI */ +global $CFG_GLPI; + +/** @var DB $DB */ +global $DB; if ($_REQUEST["action"] == "add_tickettask") { $query = [ @@ -151,7 +155,6 @@ echo json_encode($event); } elseif ($_REQUEST["action"] == "update_task") { - $div = PluginTaskdropCalendar::addTask(); $div .= PluginTaskdropCalendar::addReminder(); echo $div; @@ -177,4 +180,4 @@ 'state' => 1 ]; echo json_encode($event); -} \ No newline at end of file +} diff --git a/inc/calendar.class.php b/inc/calendar.class.php index a0fa7a6..cc7cf56 100644 --- a/inc/calendar.class.php +++ b/inc/calendar.class.php @@ -38,13 +38,14 @@ class PluginTaskdropCalendar extends CommonDBTM { public static $rightname = 'calendar'; - static function getTypeName($nb = 0) + public static function getTypeName($nb = 0) { return __('TaskDrop', 'TaskDrop'); } - static function addTask() + public static function addTask() { + /** @var DB $DB */ global $DB; $div = "

" . __('Plan this task') . "

"; @@ -74,8 +75,7 @@ static function addTask() $rand = rand(); $div .= "
"; - $div .= Toolbox::addslashes_deep(Toolbox::stripTags($row['task_content'])) . "
"; - //$div .= Html::showToolTip($row['task_content'], ['linkid' => 'task_'.$rand, 'display' => false]); + $div .= htmlspecialchars(Toolbox::stripTags($row['task_content'])) . ""; } $query = [ 'FROM' => 'glpi_changetasks', @@ -87,7 +87,7 @@ static function addTask() ]; foreach ($DB->request($query) as $id => $row) { Toolbox::logInFile('taskndrop2', print_r($row, true)); - $div .= "
" . Toolbox::addslashes_deep(Toolbox::stripTags($row['content'])) . "
"; + $div .= "
" . htmlspecialchars(Toolbox::stripTags($row['content'])) . "
"; } } } else { @@ -115,7 +115,7 @@ static function addTask() foreach ($DB->request($query) as $id => $row) { $div .= "
"; - $div .= Toolbox::addslashes_deep(Toolbox::stripTags($row['task_content'])) . "
"; + $div .= htmlspecialchars(Toolbox::stripTags($row['task_content'])) . ""; } $query = [ 'FROM' => 'glpi_changetasks', @@ -126,7 +126,7 @@ static function addTask() ] ]; foreach ($DB->request($query) as $id => $row) { - $div .= "
" . Toolbox::addslashes_deep(Toolbox::stripTags($row['content'])) . "
"; + $div .= "
" . htmlspecialchars(Toolbox::stripTags($row['content'])) . "
"; } } } @@ -135,9 +135,9 @@ static function addTask() return $div; } - - static function addReminder() + public static function addReminder() { + /** @var DB $DB */ global $DB; $div = "

" . __('Planning reminder') . "

"; @@ -154,16 +154,17 @@ static function addReminder() ] ]; foreach ($DB->request($query) as $id => $row) { - $div .= "
" . Toolbox::addslashes_deep(Toolbox::stripTags($row['name'])) . "
"; - } + $div .= "
" . htmlspecialchars(Toolbox::stripTags($row['name'])) . "
"; + } } } } return $div; } - static function listTask($params) + public static function listTask($params) { + /** @var array $CFG_GLPI */ global $CFG_GLPI; $options = $params['options']; diff --git a/setup.php b/setup.php index fcb765c..9286897 100644 --- a/setup.php +++ b/setup.php @@ -67,6 +67,7 @@ function plugin_taskdrop_check_config($verbose = false) function plugin_init_taskdrop() { + /** @var array $PLUGIN_HOOKS */ global $PLUGIN_HOOKS; $PLUGIN_HOOKS['csrf_compliant']['taskdrop'] = true; diff --git a/tools/migrate_accounts.php b/tools/migrate_accounts.php index 0401ea9..e6e4cc9 100644 --- a/tools/migrate_accounts.php +++ b/tools/migrate_accounts.php @@ -188,7 +188,8 @@ function plugin_accounts_AddRoundKey($state, $w, $rnd, $Nb) function plugin_accounts_SubBytes($s, $Nb) { // apply SBox to state S - $Sbox = [0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, + $Sbox = [ + 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75, @@ -203,7 +204,8 @@ function plugin_accounts_SubBytes($s, $Nb) 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a, 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e, 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf, - 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16]; + 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16 + ]; for ($r = 0; $r < 4; $r++) { for ($c = 0; $c < $Nb; $c++) { $s[$r][$c] = $Sbox[$s[$r][$c]]; @@ -267,7 +269,8 @@ function plugin_accounts_MixColumns($s, $Nb) function plugin_accounts_KeyExpansion($key) { // generate Key Schedule from Cipher Key - $Rcon = [[0x00, 0x00, 0x00, 0x00], + $Rcon = [ + [0x00, 0x00, 0x00, 0x00], [0x01, 0x00, 0x00, 0x00], [0x02, 0x00, 0x00, 0x00], [0x04, 0x00, 0x00, 0x00], @@ -277,7 +280,8 @@ function plugin_accounts_KeyExpansion($key) [0x40, 0x00, 0x00, 0x00], [0x80, 0x00, 0x00, 0x00], [0x1b, 0x00, 0x00, 0x00], - [0x36, 0x00, 0x00, 0x00]]; + [0x36, 0x00, 0x00, 0x00] + ]; $Nb = 4; // block size (in words): no of columns in state (fixed at 4 for AES) $Nk = count($key) / 4; // key length (in words): 4/6/8 for 128/192/256-bit keys $Nr = $Nk + 6; // no of rounds: 10/12/14 for 128/192/256-bit keys @@ -316,7 +320,8 @@ function plugin_accounts_KeyExpansion($key) */ function plugin_accounts_SubWord($w) { - $Sbox = [0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, + $Sbox = [ + 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75, @@ -331,7 +336,8 @@ function plugin_accounts_SubWord($w) 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a, 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e, 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf, - 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16]; + 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16 + ]; for ($i = 0; $i < 4; $i++) { $w[$i] = $Sbox[$w[$i]]; } From 908a7145064a071a4263ebee5dd490dd2a5d7981 Mon Sep 17 00:00:00 2001 From: maria Date: Fri, 14 Nov 2025 12:44:08 +0100 Subject: [PATCH 3/5] glpi11 --- ajax/planning.php | 6 ++---- inc/calendar.class.php | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/ajax/planning.php b/ajax/planning.php index dcbef31..bd4d323 100644 --- a/ajax/planning.php +++ b/ajax/planning.php @@ -43,10 +43,8 @@ } /** @var array $CFG_GLPI */ -global $CFG_GLPI; - -/** @var DB $DB */ -global $DB; +/** @var \DBmysql $DB */ +global $DB, $CFG_GLPI; if ($_REQUEST["action"] == "add_tickettask") { $query = [ diff --git a/inc/calendar.class.php b/inc/calendar.class.php index cc7cf56..84a5771 100644 --- a/inc/calendar.class.php +++ b/inc/calendar.class.php @@ -45,7 +45,7 @@ public static function getTypeName($nb = 0) public static function addTask() { - /** @var DB $DB */ + /** @var \DBmysql $DB */ global $DB; $div = "

" . __('Plan this task') . "

"; @@ -155,7 +155,7 @@ public static function addReminder() ]; foreach ($DB->request($query) as $id => $row) { $div .= "
" . htmlspecialchars(Toolbox::stripTags($row['name'])) . "
"; - } + } } } } From 8204a3fe9f2c8796a3d997e0b9c533760dfe5205 Mon Sep 17 00:00:00 2001 From: maria Date: Fri, 14 Nov 2025 14:37:19 +0100 Subject: [PATCH 4/5] glpi11 --- inc/calendar.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/calendar.class.php b/inc/calendar.class.php index 84a5771..a6e1849 100644 --- a/inc/calendar.class.php +++ b/inc/calendar.class.php @@ -137,7 +137,7 @@ public static function addTask() public static function addReminder() { - /** @var DB $DB */ + /** @var \DBmysql $DB */ global $DB; $div = "

" . __('Planning reminder') . "

"; From 570e8372b3da18dbdd0443259947dfa9b931fe97 Mon Sep 17 00:00:00 2001 From: FrancisTicgal Date: Mon, 17 Nov 2025 09:15:35 +0100 Subject: [PATCH 5/5] php-cs and codesniffer fixes --- ajax/planning.php | 30 +++++++++++++++--------------- hook.php | 12 ++++++------ inc/calendar.class.php | 18 +++++++++--------- setup.php | 4 ++-- tools/codesniffer.sh | 10 ++++++++++ tools/migrate_accounts.php | 6 +++--- 6 files changed, 45 insertions(+), 35 deletions(-) create mode 100755 tools/codesniffer.sh diff --git a/ajax/planning.php b/ajax/planning.php index bd4d323..c1f9f1a 100644 --- a/ajax/planning.php +++ b/ajax/planning.php @@ -58,12 +58,12 @@ 'FKEY' => [ 'glpi_tickets' => 'id', 'glpi_tickettasks' => 'tickets_id', - ] - ] + ], + ], ], 'WHERE' => [ 'glpi_tickettasks.id' => $_REQUEST["id"], - ] + ], ]; $req = $DB->request($query); @@ -79,7 +79,7 @@ 'url' => $CFG_GLPI['root_doc'] . '/front/ticket.form.php?id=' . $row['tickets_id'], 'itemtype' => 'TicketTask', 'items_id' => $_REQUEST["id"], - 'state' => $row['state'] + 'state' => $row['state'], ]; if ($row['actiontime'] > 0) { @@ -95,7 +95,7 @@ 'begin' => date("Y-m-d H:i", strtotime($_REQUEST['start'])), 'end' => $end, 'actiontime' => $actiontime, - 'users_id_tech' => $tickettask->fields['users_id_tech'] + 'users_id_tech' => $tickettask->fields['users_id_tech'], ]); echo json_encode($event); @@ -111,12 +111,12 @@ 'FKEY' => [ 'glpi_changes' => 'id', 'glpi_changetasks' => 'changes_id', - ] - ] + ], + ], ], 'WHERE' => [ 'glpi_changetasks.id' => $_REQUEST["id"], - ] + ], ]; $req = $DB->request($query); @@ -132,7 +132,7 @@ 'url' => $CFG_GLPI['root_doc'] . '/front/change.form.php?id=' . $row['changes_id'], 'itemtype' => 'ChangeTask', 'items_id' => $_REQUEST["id"], - 'state' => $row['state'] + 'state' => $row['state'], ]; if ($row['actiontime'] > 0) { @@ -148,7 +148,7 @@ 'begin' => date("Y-m-d H:i", strtotime($_REQUEST['start'])), 'end' => $end, 'actiontime' => $actiontime, - 'users_id_tech' => $changetask->fields['users_id_tech'] + 'users_id_tech' => $changetask->fields['users_id_tech'], ]); echo json_encode($event); @@ -156,18 +156,18 @@ $div = PluginTaskdropCalendar::addTask(); $div .= PluginTaskdropCalendar::addReminder(); echo $div; -} else if ($_REQUEST["action"] == "add_reminder") { +} elseif ($_REQUEST["action"] == "add_reminder") { $end = date("Y-m-d H:i", strtotime($_REQUEST['start'] . " +30 minutes")); $DB->update( 'glpi_reminders', [ 'begin' => $_REQUEST['start'], 'end' => $end, - 'is_planned' => 1 + 'is_planned' => 1, ], [ - 'id' => $_REQUEST["id"] - ] + 'id' => $_REQUEST["id"], + ], ); $event = [ 'start' => $_REQUEST['start'], @@ -175,7 +175,7 @@ 'url' => $CFG_GLPI['root_doc'] . '/front/reminder.form.php?id=' . $_REQUEST["id"], 'itemtype' => 'Reminder', 'items_id' => $_REQUEST["id"], - 'state' => 1 + 'state' => 1, ]; echo json_encode($event); } diff --git a/hook.php b/hook.php index f0eae45..c6ac2bb 100644 --- a/hook.php +++ b/hook.php @@ -39,13 +39,13 @@ function plugin_taskdrop_install() $migration = new Migration(PLUGIN_TASKDROP_VERSION); - // Parse inc directory + // Parse inc directory foreach (glob(dirname(__FILE__) . '/inc/*') as $filepath) { - // Load *.class.php files and get the class name + // Load *.class.php files and get the class name if (preg_match("/inc.(.+)\.class.php/", $filepath, $matches)) { $classname = 'PluginTaskdrop' . ucfirst($matches[1]); include_once($filepath); - // If the install method exists, load it + // If the install method exists, load it if (method_exists($classname, 'install')) { $classname::install($migration); } @@ -59,13 +59,13 @@ function plugin_taskdrop_uninstall() $migration = new Migration(PLUGIN_TASKDROP_VERSION); - // Parse inc directory + // Parse inc directory foreach (glob(dirname(__FILE__) . '/inc/*') as $filepath) { - // Load *.class.php files and get the class name + // Load *.class.php files and get the class name if (preg_match("/inc.(.+)\.class.php/", $filepath, $matches)) { $classname = 'PluginTaskdrop' . ucfirst($matches[1]); include_once($filepath); - // If the install method exists, load it + // If the install method exists, load it if (method_exists($classname, 'uninstall')) { $classname::uninstall($migration); } diff --git a/inc/calendar.class.php b/inc/calendar.class.php index a6e1849..21f536f 100644 --- a/inc/calendar.class.php +++ b/inc/calendar.class.php @@ -61,15 +61,15 @@ public static function addTask() 'FKEY' => [ 'glpi_tickettasks' => 'tickets_id', 'glpi_tickets' => 'id', - ] + ], ], ], 'WHERE' => [ 'state' => 1, 'begin' => null, 'users_id_tech' => $actor[1], - 'glpi_tickets.status' => ['<', 5] - ] + 'glpi_tickets.status' => ['<', 5], + ], ]; foreach ($DB->request($query, '', true) as $id => $row) { $rand = rand(); @@ -83,7 +83,7 @@ public static function addTask() 'state' => 1, 'begin' => null, 'users_id_tech' => $actor[1], - ] + ], ]; foreach ($DB->request($query) as $id => $row) { Toolbox::logInFile('taskndrop2', print_r($row, true)); @@ -102,15 +102,15 @@ public static function addTask() 'FKEY' => [ 'glpi_tickettasks' => 'tickets_id', 'glpi_tickets' => 'id', - ] + ], ], ], 'WHERE' => [ 'state' => 1, 'begin' => null, 'groups_id_tech' => $group[1], - 'glpi_tickets.status' => ['<', 5] - ] + 'glpi_tickets.status' => ['<', 5], + ], ]; foreach ($DB->request($query) as $id => $row) { $div .= "
1, 'begin' => null, 'groups_id_tech' => $group[1], - ] + ], ]; foreach ($DB->request($query) as $id => $row) { $div .= "
" . htmlspecialchars(Toolbox::stripTags($row['content'])) . "
"; @@ -151,7 +151,7 @@ public static function addReminder() 'state' => 1, 'begin' => null, 'users_id' => $actor[1], - ] + ], ]; foreach ($DB->request($query) as $id => $row) { $div .= "
" . htmlspecialchars(Toolbox::stripTags($row['name'])) . "
"; diff --git a/setup.php b/setup.php index 9286897..5c956f1 100644 --- a/setup.php +++ b/setup.php @@ -52,8 +52,8 @@ function plugin_version_taskdrop() 'glpi' => [ 'min' => PLUGIN_TASKDROP_MIN_GLPI, 'max' => PLUGIN_TASKDROP_MAX_GLPI, - ] - ] + ], + ], ]; } diff --git a/tools/codesniffer.sh b/tools/codesniffer.sh new file mode 100755 index 0000000..942d3b2 --- /dev/null +++ b/tools/codesniffer.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +TOOL_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" + +# if exist vendor/bin/phpcbf, use it +if [ -f "$TOOL_DIR/../vendor/bin/phpcbf" ]; then + cd "$TOOL_DIR/.." + vendor/bin/phpcbf + exit 0 +fi \ No newline at end of file diff --git a/tools/migrate_accounts.php b/tools/migrate_accounts.php index e6e4cc9..beb0912 100644 --- a/tools/migrate_accounts.php +++ b/tools/migrate_accounts.php @@ -204,7 +204,7 @@ function plugin_accounts_SubBytes($s, $Nb) 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a, 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e, 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf, - 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16 + 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16, ]; for ($r = 0; $r < 4; $r++) { for ($c = 0; $c < $Nb; $c++) { @@ -280,7 +280,7 @@ function plugin_accounts_KeyExpansion($key) [0x40, 0x00, 0x00, 0x00], [0x80, 0x00, 0x00, 0x00], [0x1b, 0x00, 0x00, 0x00], - [0x36, 0x00, 0x00, 0x00] + [0x36, 0x00, 0x00, 0x00], ]; $Nb = 4; // block size (in words): no of columns in state (fixed at 4 for AES) $Nk = count($key) / 4; // key length (in words): 4/6/8 for 128/192/256-bit keys @@ -336,7 +336,7 @@ function plugin_accounts_SubWord($w) 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a, 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e, 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf, - 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16 + 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16, ]; for ($i = 0; $i < 4; $i++) { $w[$i] = $Sbox[$w[$i]];