diff --git a/include/class_Combinations.inc b/include/class_Combinations.inc index 65027c70e8df4d852b58736a2f86495aa3834768..68b681f72f1e03c09805867700bd627327ba609e 100755 --- a/include/class_Combinations.inc +++ b/include/class_Combinations.inc @@ -36,12 +36,12 @@ class Combinations implements Iterator $this->rewind(); } - function key () + function key () : mixed { return $this->pos; } - function current () + function current () : mixed { $r = []; for ($i = 0; $i < $this->size; $i++) { @@ -50,7 +50,7 @@ class Combinations implements Iterator return $r; } - function next () + function next () : void { if ($this->_next()) { $this->pos++; @@ -59,13 +59,13 @@ class Combinations implements Iterator } } - function rewind () + function rewind () : void { $this->current = range(0, $this->size); $this->pos = 0; } - function valid () + function valid () : bool { return ($this->pos >= 0); } diff --git a/include/class_config.inc b/include/class_config.inc index e8eb7c8f0e1cfbd76d4834771bc318d065b3f1c8..46e8954ab0eca6caac73a7cb4647d83301d396e2 100755 --- a/include/class_config.inc +++ b/include/class_config.inc @@ -1004,7 +1004,7 @@ class config } if (!isset($this->data['CATEGORIES'][$cat]['description'])) { $this->data['CATEGORIES'][$cat]['description'] = $infos['name']; - preg_match_all('/objectClass=([^= \)\(]+)/', $infos['filter'], $m); + preg_match_all('/objectClass=([^= \)\(]+)/', $infos['filter'] ?? '', $m); $this->data['CATEGORIES'][$cat]['objectClass'] = $m[1]; } } diff --git a/include/login/class_LoginMethod.inc b/include/login/class_LoginMethod.inc index d036f488ff968795121a75fbe6638819a3548b22..22465a024718c25054ee192c2bcc38c25b7feca4 100755 --- a/include/login/class_LoginMethod.inc +++ b/include/login/class_LoginMethod.inc @@ -152,6 +152,31 @@ class LoginMethod return TRUE; } + // ################################ Below Quick dirty fix for php8.2 for non-serializable items ###################### + static function backupSessionToVariable() + { + $backupData = $_SESSION; + + // Remove non-serializable data + if (isset($backupData['config']->parser)) { + unset($backupData['config']->parser); + } + + return $backupData; + } + + static function restoreSessionFromVariable($backupData) + { + $_SESSION = $backupData; + + // Reinitialize non-serializable objects + if (isset($_SESSION['config'])) { + $_SESSION['config']->parser = new XMLParser(); + } + } + + // ################################# Above Quick dirty fix for php8.2 for non-serializable items ###################### + /*! \brief Connect user */ static function connect () { @@ -159,9 +184,16 @@ class LoginMethod $ui = session::get('ui'); - //Create new session ID to avoir session_fixation security issues after sucess login + // #### QUICK AND DIRTY FIX FOR PHP 8.2 + // Backup session to a variable + $sessionBackup = LoginMethod::backupSessionToVariable(); + + // Create new session ID in order to have session_fixation security issues after success login session_regenerate_id(); + // #### QUICK AND DIRTY FIX FOR PHP 8.2 + LoginMethod::restoreSessionFromVariable($sessionBackup); + /* Not account expired or password forced change go to main page */ logging::log('security', 'login', $ui->uid, [], 'Logged in successfully'); session::set('connected', 1); diff --git a/include/management/class_EntrySortIterator.inc b/include/management/class_EntrySortIterator.inc index 158bc96e8b47f4b01147c0db24408dc03fe293d4..40e13bebbf3ada3c010abf61fc209bd8b842b3e4 100755 --- a/include/management/class_EntrySortIterator.inc +++ b/include/management/class_EntrySortIterator.inc @@ -60,7 +60,7 @@ class EntrySortIterator implements Iterator /*! * \brief Put the array pointer to the first element */ - function rewind () + function rewind () : void { reset($this->data); } @@ -70,7 +70,7 @@ class EntrySortIterator implements Iterator * * \return The current element pointed by array pointer */ - function current () + function current () : mixed { return current($this->data); } @@ -80,7 +80,7 @@ class EntrySortIterator implements Iterator * * \return the key element of the array */ - function key () + function key () : mixed { return key($this->data); } @@ -88,7 +88,7 @@ class EntrySortIterator implements Iterator /*! * \brief Get the next data element */ - function next () + function next () : void { next($this->data); } @@ -98,7 +98,7 @@ class EntrySortIterator implements Iterator * * \return TRUE if the array is valid, return FALSE otherwise */ - function valid () + function valid () : bool { return (key($this->data) !== NULL); } diff --git a/include/management/class_ListingEntry.inc b/include/management/class_ListingEntry.inc index 8fdc42aa5f7186369287e744f1f496e0af0ae0ac..759c6acb95f1d05330456f476ee3830e76973dde 100755 --- a/include/management/class_ListingEntry.inc +++ b/include/management/class_ListingEntry.inc @@ -57,22 +57,22 @@ class ListingEntry implements ArrayAccess $this->row = $row; } - public function offsetSet ($offset, $value) + public function offsetSet ($offset, $value) : void { $this->attrs[$offset] = $value; } - public function offsetExists ($offset) + public function offsetExists ($offset) : bool { return isset($this->attrs[$offset]); } - public function offsetUnset ($offset) + public function offsetUnset ($offset) : void { unset($this->attrs[$offset]); } - public function offsetGet ($offset) + public function offsetGet ($offset) : mixed { return (isset($this->attrs[$offset]) ? $this->attrs[$offset] : NULL); } diff --git a/include/password-methods/class_passwordMethod.inc b/include/password-methods/class_passwordMethod.inc index 30a1b74d7bb3bbeb0d4f2aff9f1d55b3c5ad2829..841a0889bac38fb41c84385206147f558ea27b7e 100755 --- a/include/password-methods/class_passwordMethod.inc +++ b/include/password-methods/class_passwordMethod.inc @@ -225,7 +225,7 @@ abstract class passwordMethod static function get_available_methods (): array { global $class_mapping; - $ret = FALSE; + $ret = []; $i = 0; if (!session::is_set('passwordMethod::get_available_methods')) {