Skip to content

Commit

Permalink
fix "Only variables should be passed by reference" error and don't di…
Browse files Browse the repository at this point in the history
…sclose raw SEED value, ref. 3446a34
  • Loading branch information
ikkez committed May 27, 2018
1 parent a081736 commit 8d41c1e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions db/jig/session.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,9 @@ function __construct(\DB\Jig $db,$file='sessions',$onsuspect=NULL,$key=NULL) {
register_shutdown_function('session_commit');
$fw=\Base::instance();
$headers=$fw->HEADERS;
$this->_csrf=$fw->SEED.'.'.$fw->hash(
$this->_csrf=$fw->hash($fw->SEED.
extension_loaded('openssl')?
array_pop(unpack('L',openssl_random_pseudo_bytes(4))):
implode(unpack('L',openssl_random_pseudo_bytes(4))):
mt_rand()
);
if ($key)
Expand Down
4 changes: 2 additions & 2 deletions db/mongo/session.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,9 @@ function __construct(\DB\Mongo $db,$table='sessions',$onsuspect=NULL,$key=NULL)
register_shutdown_function('session_commit');
$fw=\Base::instance();
$headers=$fw->HEADERS;
$this->_csrf=$fw->SEED.'.'.$fw->hash(
$this->_csrf=$fw->hash($fw->SEED.
extension_loaded('openssl')?
array_pop(unpack('L',openssl_random_pseudo_bytes(4))):
implode(unpack('L',openssl_random_pseudo_bytes(4))):
mt_rand()
);
if ($key)
Expand Down
4 changes: 2 additions & 2 deletions db/sql/session.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,9 @@ function __construct(\DB\SQL $db,$table='sessions',$force=TRUE,$onsuspect=NULL,$
register_shutdown_function('session_commit');
$fw=\Base::instance();
$headers=$fw->HEADERS;
$this->_csrf=$fw->SEED.'.'.$fw->hash(
$this->_csrf=$fw->hash($fw->SEED.
extension_loaded('openssl')?
array_pop(unpack('L',openssl_random_pseudo_bytes(4))):
implode(unpack('L',openssl_random_pseudo_bytes(4))):
mt_rand()
);
if ($key)
Expand Down
4 changes: 2 additions & 2 deletions session.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ function __construct($onsuspect=NULL,$key=NULL,$cache=null) {
register_shutdown_function('session_commit');
$fw=\Base::instance();
$headers=$fw->HEADERS;
$this->_csrf=$fw->SEED.'.'.$fw->hash(
$this->_csrf=$fw->hash($fw->SEED.
extension_loaded('openssl')?
array_pop(unpack('L',openssl_random_pseudo_bytes(4))):
implode(unpack('L',openssl_random_pseudo_bytes(4))):
mt_rand()
);
if ($key)
Expand Down

0 comments on commit 8d41c1e

Please sign in to comment.