diff options
| author | spiderr <spiderr@bitweaver.org> | 2025-05-13 10:31:41 -0400 |
|---|---|---|
| committer | spiderr <spiderr@bitweaver.org> | 2025-05-13 10:31:41 -0400 |
| commit | a50896c163d1ca5a4ff25bc99362296845d4c10a (patch) | |
| tree | c4bb83ec44f489ffc4a9293d985a46a67b154f47 | |
| parent | d6c495d7738a91ab87fc41058743d95f242b51c4 (diff) | |
| download | users-a50896c163d1ca5a4ff25bc99362296845d4c10a.tar.gz users-a50896c163d1ca5a4ff25bc99362296845d4c10a.tar.bz2 users-a50896c163d1ca5a4ff25bc99362296845d4c10a.zip | |
PHP8 fixes: curly params; use ::verifyIdParameter(); default site_session_lifetime value
| -rw-r--r-- | includes/bit_setup_inc.php | 4 | ||||
| -rw-r--r-- | includes/classes/BitUser.php | 6 | ||||
| -rw-r--r-- | smartyplugins/function.captcha.php | 4 |
3 files changed, 7 insertions, 7 deletions
diff --git a/includes/bit_setup_inc.php b/includes/bit_setup_inc.php index dc0354d..0c648a9 100644 --- a/includes/bit_setup_inc.php +++ b/includes/bit_setup_inc.php @@ -69,9 +69,9 @@ if( $gBitSystem->isFeatureActive( 'site_store_session_db' ) && !empty( $gBitDbTy session_name( BIT_SESSION_NAME ); if( $gBitSystem->isFeatureActive( 'users_remember_me' )) { - session_set_cookie_params( $gBitSystem->getConfig( 'site_session_lifetime' ), $gBitSystem->getConfig( 'cookie_path', BIT_ROOT_URL ), $gBitSystem->getConfig( 'cookie_domain', '' )); + session_set_cookie_params( $gBitSystem->getConfig( 'site_session_lifetime', 0 ), $gBitSystem->getConfig( 'cookie_path', BIT_ROOT_URL ), $gBitSystem->getConfig( 'cookie_domain', '' )); } else { - session_set_cookie_params( $gBitSystem->getConfig( 'site_session_lifetime' ), BIT_ROOT_URL, '' ); + session_set_cookie_params( $gBitSystem->getConfig( 'site_session_lifetime', 0 ), BIT_ROOT_URL, '' ); } // just use a simple COOKIE (unique random string) that is linked to the users_cnxn table. diff --git a/includes/classes/BitUser.php b/includes/classes/BitUser.php index cc237d1..366e3e7 100644 --- a/includes/classes/BitUser.php +++ b/includes/classes/BitUser.php @@ -164,7 +164,7 @@ class BitUser extends LibertyMime { $this->mInfo['user_id'] = $this->mInfo['uu_user_id']; $this->mInfo['is_registered'] = $this->isRegistered(); foreach( array( 'portrait', 'avatar', 'logo' ) as $img ) { - $this->mInfo[$img.'_path'] = $this->getSourceFile( array( 'user_id'=>$this->getField( 'user_id' ), 'package'=>liberty_mime_get_storage_sub_dir_name( array( 'mime_type' => $this->getField( $img.'_mime_type' ), 'name' => $this->getField( $img.'_file_name' ) ) ), 'file_name' => basename( $this->mInfo[$img.'_file_name'] ), 'sub_dir' => $this->getField( $img.'_attachment_id' ), 'mime_type' => $this->getField( $img.'_mime_type' ) ) ); + $this->mInfo[$img.'_path'] = $this->getSourceFile( array( 'user_id'=>$this->getField( 'user_id' ), 'package'=>liberty_mime_get_storage_sub_dir_name( array( 'mime_type' => $this->getField( $img.'_mime_type' ), 'name' => $this->getField( $img.'_file_name' ) ) ), 'file_name' => basename( $this->mInfo[$img.'_file_name'] ?? '' ), 'sub_dir' => $this->getField( $img.'_attachment_id' ), 'mime_type' => $this->getField( $img.'_mime_type' ) ) ); $this->mInfo[$img.'_url'] = liberty_fetch_thumbnail_url( array( 'source_file'=>$this->mInfo[$img.'_path'], 'size' => 'small', 'mime_image' => FALSE )); } @@ -1297,9 +1297,9 @@ class BitUser extends LibertyMime { } for( $i = 0; $i < $pLength; $i++ ) { if( $i % 2 ) { - $ret .= $vocales{rand( 0, strlen( $vocales ) - 1 )}; + $ret .= $vocales[rand( 0, strlen( $vocales ) - 1 )]; } else { - $ret .= $consonantes{rand( 0, strlen( $consonantes ) - 1 )}; + $ret .= $consonantes[rand( 0, strlen( $consonantes ) - 1 )]; } } return $ret; diff --git a/smartyplugins/function.captcha.php b/smartyplugins/function.captcha.php index e135f19..c52cb46 100644 --- a/smartyplugins/function.captcha.php +++ b/smartyplugins/function.captcha.php @@ -33,10 +33,10 @@ function smarty_function_captcha( $pParams, &$gBitSmarty ) { $pParams['source'] = USERS_PKG_URL."freecap/freecap.php"; } else { $getString = 'size='.$pParams['size']; - if( @BitBase::verifyId( $pParams['width'] ) ) { + if( @BitBase::verifyIdParameter( $pParams, 'width' ) ) { $getString .= '&width='.$pParams['width']; } - if( @BitBase::verifyId( $pParams['height'] ) ) { + if( @BitBase::verifyIdParameter( $pParams, 'height' ) ) { $getString .= '&height='.$pParams['height']; } $pParams['source'] = USERS_PKG_URL."captcha_image.php?$getString"; |
