Browse Source

Fixed Type Conversion bug (#4981)

* Fixed Type Conversion bug by casting the REDIRECT_CODE from the config file to int

* Fix linting

* Fixed linting again...

---------

Co-authored-by: Christoph Schläpfer <c.schlaepfer@datact.ch>
Christoph Schlaepfer 10 months ago
parent
commit
113d98aec5
1 changed files with 3 additions and 1 deletions
  1. 3 1
      web/edit/web/index.php

+ 3 - 1
web/edit/web/index.php

@@ -124,7 +124,9 @@ if (
 
 
 $redirect_code_options = [301, 302];
 $redirect_code_options = [301, 302];
 $v_redirect = $data[$v_domain]["REDIRECT"];
 $v_redirect = $data[$v_domain]["REDIRECT"];
-$v_redirect_code = $data[$v_domain]["REDIRECT_CODE"];
+$v_redirect_code = isset($data[$v_domain]["REDIRECT_CODE"])
+	? intval($data[$v_domain]["REDIRECT_CODE"])
+	: 302;
 if (!in_array($v_redirect, ["www." . $v_domain, $v_domain])) {
 if (!in_array($v_redirect, ["www." . $v_domain, $v_domain])) {
 	$v_redirect_custom = $v_redirect;
 	$v_redirect_custom = $v_redirect;
 }
 }