Skip to content

Commit 52f396b

Browse files
committed
fix: Use lang parameter from request and server as fallback in case it is not available in cookie or query param
1 parent e2cc653 commit 52f396b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/AppArena/Models/Entities/AbstractEntity.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,16 @@ public function getLang() {
461461
return $this->lang;
462462
}
463463

464+
if ( isset( $_REQUEST['lang'] ) ) {
465+
$this->lang = $_REQUEST['lang'];
466+
return $this->lang;
467+
}
468+
469+
if ( isset( $_SERVER['lang'] ) ) {
470+
$this->lang = $_SERVER['lang'];
471+
return $this->lang;
472+
}
473+
464474
// Get the default language from of the entity
465475
if ( $languages = $this->getLanguages() ) {
466476
foreach ( $languages['activated'] as $language ) {

0 commit comments

Comments
 (0)