@@ -726,7 +726,7 @@ |
||
| 726 | 726 | $displayTime = floor($hours / 24) . ' ' . new XenForo_Phrase('threemagw_days'); |
| 727 | 727 | } |
| 728 | 728 | |
| 729 | - return (string)$displayTime; |
|
| 729 | + return (string) $displayTime; |
|
| 730 | 730 | } |
| 731 | 731 | |
| 732 | 732 | /** |
@@ -397,7 +397,7 @@ discard block |
||
| 397 | 397 | /** @var array $tableFields fields of table "files" */ |
| 398 | 398 | $tableFields = $this->_getFields()[ThreemaGateway_Model_Messages::DB_TABLE_FILES]; |
| 399 | 399 | // remove keys, which are automatically set |
| 400 | - unset($tableFields['file_id']); // (auto increment) |
|
| 400 | + unset($tableFields['file_id']); // (auto increment) |
|
| 401 | 401 | unset($tableFields['is_saved']); // (default value=1) |
| 402 | 402 | // we do only care about the keys |
| 403 | 403 | /** @var array $tableKeys extracted keys from fields */ |
@@ -405,7 +405,7 @@ discard block |
||
| 405 | 405 | |
| 406 | 406 | // create insert query for this item |
| 407 | 407 | $this->_db->query('INSERT INTO `' . ThreemaGateway_Model_Messages::DB_TABLE_FILES . '` |
| 408 | - ( `' . implode('`, `', $tableKeys) . '`) |
|
| 408 | + ( `' . implode('`, `', $tableKeys) . '`) |
|
| 409 | 409 | VALUES (' . implode(', ', array_fill(0, count($tableKeys), '?')) . ')', // only (?, ?, ...) |
| 410 | 410 | [ |
| 411 | 411 | $this->get('message_id'), //message_id |
@@ -428,7 +428,7 @@ discard block |
||
| 428 | 428 | |
| 429 | 429 | // create insert query for this item |
| 430 | 430 | $this->_db->query('INSERT INTO `' . ThreemaGateway_Model_Messages::DB_TABLE_DELIVERY_RECEIPT . '` |
| 431 | - ( `' . implode('`, `', $tableKeys) . '`) |
|
| 431 | + ( `' . implode('`, `', $tableKeys) . '`) |
|
| 432 | 432 | VALUES (' . implode(', ', array_fill(0, count($tableKeys), '?')) . ')', // only (?, ?, ...) |
| 433 | 433 | [ |
| 434 | 434 | $this->get('message_id'), //message_id |
@@ -472,7 +472,7 @@ discard block |
||
| 472 | 472 | |
| 473 | 473 | // remove values from database |
| 474 | 474 | $this->_db->query('UPDATE `' . ThreemaGateway_Model_Messages::DB_TABLE_MESSAGES . '` |
| 475 | - SET `' . implode('`=null, `', $tableKeys) . '`=null, |
|
| 475 | + SET `' . implode('`=null, `', $tableKeys) . '`=null, |
|
| 476 | 476 | `date_received`=' . $this->_db->quote($this->getRoundedReceiveDate()) . ' |
| 477 | 477 | WHERE ' . $this->getUpdateCondition(ThreemaGateway_Model_Messages::DB_TABLE_MESSAGES)); |
| 478 | 478 | } |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | public function lookupMail($mail) |
| 60 | 60 | { |
| 61 | 61 | // check permission |
| 62 | - if (! $this->permissions->hasPermission('lookup')) { |
|
| 62 | + if (!$this->permissions->hasPermission('lookup')) { |
|
| 63 | 63 | throw new XenForo_Exception(new XenForo_Phrase('threemagw_permission_error')); |
| 64 | 64 | } |
| 65 | 65 | |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | public function getCapabilities($threemaId) |
| 87 | 87 | { |
| 88 | 88 | // check permission |
| 89 | - if (! $this->permissions->hasPermission('lookup')) { |
|
| 89 | + if (!$this->permissions->hasPermission('lookup')) { |
|
| 90 | 90 | throw new XenForo_Exception(new XenForo_Phrase('threemagw_permission_error')); |
| 91 | 91 | } |
| 92 | 92 | |
@@ -57,9 +57,9 @@ |
||
| 57 | 57 | public static function getOldestPossibleReplayAttackDate() |
| 58 | 58 | { |
| 59 | 59 | /** @var XenForo_Options $options */ |
| 60 | - $options = XenForo_Application::getOptions(); |
|
| 60 | + $options = XenForo_Application::getOptions(); |
|
| 61 | 61 | /** @var int $rejectOlDefault the default maximum age of a message according*/ |
| 62 | - $rejectOlDefault = strtotime('-14 days', XenForo_Application::$time);; |
|
| 62 | + $rejectOlDefault = strtotime('-14 days', XenForo_Application::$time); ; |
|
| 63 | 63 | /** @var int $rejectOld the maximum age of a message according to the options */ |
| 64 | 64 | $rejectOldOption = ''; |
| 65 | 65 | if ($options->threema_gateway_verify_receive_time && $options->threema_gateway_verify_receive_time['enabled']) { |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | public static function getRandomString($length, $keyspace = 'abcdefghijklmnopqrstuvwxyz01234567') |
| 62 | 62 | { |
| 63 | 63 | /** @var string $output */ |
| 64 | - $output = ''; |
|
| 64 | + $output = ''; |
|
| 65 | 65 | if (self::canUseLibsodium()) { |
| 66 | 66 | /** @var int $keysize */ |
| 67 | 67 | $keysize = strlen($keyspace); |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | // https://stackoverflow.com/questions/6058394/unicode-character-in-php-string |
| 26 | 26 | |
| 27 | 27 | // RegEx: https://regex101.com/r/yS2zX8/3 |
| 28 | - return preg_replace_callback('/(\\\\u([0-9a-fA-F]{4}))+/', function ($match) { |
|
| 28 | + return preg_replace_callback('/(\\\\u([0-9a-fA-F]{4}))+/', function($match) { |
|
| 29 | 29 | return json_decode('"' . $match[0] . '"'); |
| 30 | 30 | }, $string); |
| 31 | 31 | } |