Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NEW: setDefaultLangs('auto') now check mysoc and conf #31341

Open
wants to merge 2 commits into
base: 17.0
Choose a base branch
from

Conversation

atm-thomasb
Copy link
Contributor

NEW|New setDefaultLangs now checks MAIN_LANG_DEFAULT and mysoc lang if 'auto'

Currently, setDefaultLangs with 'auto' argument sets the lang to the server's.
I've added so that it will beforehand check if $mysoc->defaultlang is defined and if yes it will take its lang,
otherwise if 'MAIN_LANG_DEFAULT' is defined it takes its lang.

Otherwise it does the same thing as before (server's lang).

@atm-thomasb
Copy link
Contributor Author

atm-thomasb commented Oct 10, 2024

Travis currently returns an error because it expects an output that changed with my PR:

$_SERVER['HTTP_ACCEPT_LANGUAGE'] = "' malicious text with quote";
$tmplangs->setDefaultLang('auto');
print METHOD.' $tmplangs->defaultlang='.$tmplangs->defaultlang."\n";
$this->assertEquals($tmplangs->defaultlang, 'malicioustextwithquote_MALICIOUSTEXTWITHQUOTE');

With the new system when given 'auto' it returns "en_US" instead. So it's as it's supposed to be, but is different from before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant