fix `undefined array key "lan"` error

was getting the following error from a clean build using php 8.1.2:

```"Warning: Undefined array key "lan" in ~/thebookofshaders/header.php on line 4"```

Was going to use `isset` but it seems like a banged `!empty` is used elsewhere. am not a php dev so will defer to anyone who feels more confident.
This commit is contained in:
Alec Molloy 2022-02-11 13:18:55 -05:00 committed by GitHub
parent 036c0c64f0
commit a4e0819cbc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -1,7 +1,7 @@
<!DOCTYPE html>
<?php
$html_attributes = "";
if ($_GET['lan'] == "fa") {
if (!empty($_GET['lan']) && $_GET['lan'] == "fa") {
$html_attributes = 'dir="rtl" lang="fa"';
}
echo '