Last active
January 26, 2022 16:12
-
-
Save derralf/1b0401b403175269252c361c7fca4e21 to your computer and use it in GitHub Desktop.
Allow multiple Origins für phpList
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
========================================================================= | |
Hack: Allow multiple Origins | |
z.B. für Ajax-Anmeldung von Subdomain | |
platziere dies zu oberst in /lists/config/config.php | |
========================================================================= | |
*/ | |
$custom_allowed_origins = [ | |
"http://mydomain.net", | |
"https:/mydomain.net", | |
"http://www.mydomain.net", | |
"https://www.mydomain.net", | |
"http://dev.mydomain.net", | |
"https://dev.mydomain.net", | |
"http://newsletter.mydomain.net", | |
"https:/newsletter.mydomain.net", | |
"http://newsletter-dev.mydomain.net", | |
"https:/newsletter-dev.mydomain.net" | |
]; | |
if (in_array($_SERVER["HTTP_ORIGIN"], $custom_allowed_origins)) { | |
// wenn wir hier die Konstante nicht definieren, wird dort ein Standard festgelegt: lists/admin/init.php | |
define("ACCESS_CONTROL_ALLOW_ORIGIN", $_SERVER["HTTP_ORIGIN"]); | |
// würde nicht phpList selbst den Header setzen (in lists/index.php) würde man etvl. etwas in der Art ausgeben | |
// header("Access-Control-Allow-Origin: " . $_SERVER["HTTP_ORIGIN"]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment