0

I try to setup SAML authentication in my application but I'm facing a URL

My generated URL to SimpleSAML contains & instead of & and SimpleSAML doesn't like it

Here is my piece of code that does the redirection. If I print the $url var, it's all good. For some reasons that I don't understand, my browser (or apache, or whatever) does the change from & to &

Do you have some clues about it ?

if (!headers_sent()) {
            // set the location header
            header('Location: ' . $url, true, $code);

            // disable caching of this response
            header('Pragma: no-cache');
            header('Cache-Control: no-cache, no-store, must-revalidate');
        }
2
  • 6
    "If I print the $url var, it's all good." - if you are looking at the result in a context where it gets interpreted as HTML - then it probably isn't. Because then the browser will show & as just & again, of course. Commented Nov 25 at 9:26
  • 3
    You need to provide a minimal reproducible example. Odds are that the $url value already has an HTML representation of & in it before the code you've shared starts. Commented Nov 25 at 10:03

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.