Skip to content

Commit

Permalink
Workaround if HTTP_ACCEPT_LANGUAGE does not exists (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
J0hnHawk committed Aug 15, 2019
1 parent 36cd127 commit e8acea9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion include/language.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@
exit ();
}

$languageFromBrowser = substr ( $_SERVER ['HTTP_ACCEPT_LANGUAGE'], 0, 2 );
if (isset ( $_SERVER ['HTTP_ACCEPT_LANGUAGE'] )) {
$languageFromBrowser = substr ( $_SERVER ['HTTP_ACCEPT_LANGUAGE'], 0, 2 );
} else {
$languageFromBrowser = 'en';
}
if (file_exists ( './language/' . $languageFromBrowser . '/global.lng' )) {
$defaultLanguage = $languageFromBrowser;
} else {
Expand Down
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
$webStatsVersion = '0.9.5';
$webStatsVersion = '0.9.6';
ini_set ( 'error_reporting', E_ALL );
ini_set ( 'display_errors', 1 );
ini_set ( 'log_errors', 1 );
Expand Down

0 comments on commit e8acea9

Please sign in to comment.