Skip to content

Commit

Permalink
fix: Use lang parameter from request and server as fallback in case i…
Browse files Browse the repository at this point in the history
…t is not available in cookie or query param
  • Loading branch information
cbc-ott-dev committed Jun 21, 2019
1 parent e2cc653 commit 52f396b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/AppArena/Models/Entities/AbstractEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,16 @@ public function getLang() {
return $this->lang;
}

if ( isset( $_REQUEST['lang'] ) ) {
$this->lang = $_REQUEST['lang'];
return $this->lang;
}

if ( isset( $_SERVER['lang'] ) ) {
$this->lang = $_SERVER['lang'];
return $this->lang;
}

// Get the default language from of the entity
if ( $languages = $this->getLanguages() ) {
foreach ( $languages['activated'] as $language ) {
Expand Down

0 comments on commit 52f396b

Please sign in to comment.