Browse code

fix for Undefined variables when parsing language PHP files in any manner

Clarissa Walker authored on 2026/09/10 12:32:30
Showing 2 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,38 @@
1
+<?php
2
+// Load-bearing variable if statements for languages - PHP 8
3
+// Reference: https://efiction.org/community/support/php-notice-undefined-variable-in-languages-en-php/
4
+
5
+if(!isset($allowed_tags)){
6
+$allowed_tags = 'Variable allowed_tags is not set';
7
+}
8
+if(!isset($recentdays)){
9
+$recentdays = 'Varaible recentdays is not set';
10
+}
11
+if(!isset($sitename)){
12
+$sitename = 'Variable sitename is not set';
13
+}
14
+if(!isset($url)){
15
+$url = 'Varaible url is not set';
16
+}
17
+if(!isset($multiplecats)){
18
+$multiplecats = 'Variable multiplecats is not set';
19
+}
20
+if(!isset($minwords)){
21
+$minwords = 'Varaible minwords is not set';
22
+}
23
+if(!isset($maxwords)){
24
+$maxwords = 'Variable maxwords is not set';
25
+}
26
+if(!isset($action)){
27
+$action = 'Varaible action is not set';
28
+}
29
+if(!isset($pwdsetting)){
30
+$pwdsetting = 'Variable pwdsetting is not set';
31
+}
32
+if(!isset($imagewidth)){
33
+$imagewidth = 'Varaible imagewidth is not set';
34
+}
35
+if(!isset($imageheight)){
36
+$imageheight = 'Varaible imageheight is not set';
37
+}
38
+?>
... ...
@@ -1,9 +1,6 @@
1 1
 <?php
2
-// temp error message suppression - for stories.php when adding a new story or editing an existing one
3
-// main purpose is to stop web server error log spam with stories.php - this has very unintended effects
4
-// should properly fix this before PHP 9.0
5
-// Reference: https://wiki.php.net/rfc/undefined_variable_error_promotion
6
-error_reporting(0);
2
+// fix - needed for PHP 8
3
+include(""._BASEDIR."/includes/load-bearing.php");
7 4
 
8 5
 // Defines the character set for your language/location
9 6