Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 9f39d5e1 authored by Akhil's avatar Akhil
Browse files

Check if header is set first

parent 4a9e6432
Loading
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -6,13 +6,16 @@ $_SERVER in IRequest is immutable but we want to switch the header to deliver tr

--- lib/private/L10N/Factory.php	2023-11-29 17:46:48.253716340 +0530
+++ lib/private/L10N/Factory-new.php	2023-11-29 17:47:26.194920628 +0530
@@ -478,7 +478,8 @@
@@ -478,7 +478,11 @@
 	 * @throws LanguageNotFoundException
 	 */
 	private function getLanguageFromRequest(?string $app = null): string {
-		$header = $this->request->getHeader('ACCEPT_LANGUAGE');
+		// $header = $this->request->getHeader('ACCEPT_LANGUAGE');
+		$header = '';
+		if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
+			$header = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
+		}
 		if ($header !== '') {
 			$available = $this->findAvailableLanguages($app);