X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/pie.php?a=blobdiff_plain;f=includes%2Fsession%2FSession.php;h=3dc8299be941e4277f8c3775c7315dfaefcbcba8;hb=130ec2523df12a3ca2fe0d422163696d09fcea08;hp=23d9ab383830b8925d29098227ac00c2309275d2;hpb=53ecf20db8bfc2109553e80bf932dac7321d63ec;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/session/Session.php b/includes/session/Session.php index 23d9ab3838..3dc8299be9 100644 --- a/includes/session/Session.php +++ b/includes/session/Session.php @@ -291,7 +291,7 @@ final class Session implements \Countable, \Iterator, \ArrayAccess { /** * Fetch a value from the session * @param string|int $key - * @param mixed $default Returned if $this->exists( $key ) would be false + * @param mixed|null $default Returned if $this->exists( $key ) would be false * @return mixed */ public function get( $key, $default = null ) { @@ -481,7 +481,7 @@ final class Session implements \Countable, \Iterator, \ArrayAccess { // Encrypt // @todo: import a pure-PHP library for AES instead of doing $wgSessionInsecureSecrets - $iv = \MWCryptRand::generate( 16, true ); + $iv = random_bytes( 16 ); $algorithm = self::getEncryptionAlgorithm(); switch ( $algorithm[0] ) { case 'openssl': @@ -522,7 +522,7 @@ final class Session implements \Countable, \Iterator, \ArrayAccess { /** * Fetch a value from the session that was set with self::setSecret() * @param string|int $key - * @param mixed $default Returned if $this->exists( $key ) would be false or decryption fails + * @param mixed|null $default Returned if $this->exists( $key ) would be false or decryption fails * @return mixed */ public function getSecret( $key, $default = null ) { @@ -621,31 +621,37 @@ final class Session implements \Countable, \Iterator, \ArrayAccess { * @{ */ + /** @inheritDoc */ public function count() { $data = &$this->backend->getData(); return count( $data ); } + /** @inheritDoc */ public function current() { $data = &$this->backend->getData(); return current( $data ); } + /** @inheritDoc */ public function key() { $data = &$this->backend->getData(); return key( $data ); } + /** @inheritDoc */ public function next() { $data = &$this->backend->getData(); next( $data ); } + /** @inheritDoc */ public function rewind() { $data = &$this->backend->getData(); reset( $data ); } + /** @inheritDoc */ public function valid() { $data = &$this->backend->getData(); return key( $data ) !== null; @@ -678,10 +684,12 @@ final class Session implements \Countable, \Iterator, \ArrayAccess { return $data[$offset]; } + /** @inheritDoc */ public function offsetSet( $offset, $value ) { $this->set( $offset, $value ); } + /** @inheritDoc */ public function offsetUnset( $offset ) { $this->remove( $offset ); }