Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"&" characters in organization name result in an error when trying to build metadata #576

Open
0xmerp opened this issue Mar 8, 2024 · 0 comments

Comments

@0xmerp
Copy link

0xmerp commented Mar 8, 2024

In advanced settings, when setting the organization name to something including a & character:

    'organization' => array (
        'en-US' => array(
            'name' => 'Name & Name2',
            'displayname' => 'Name & Name2',
            'url' => 'https://some-url.com'
        ),
    ),

then fetching the SP metadata:

    $samlSettings = new Settings($saml_settings);
    $metadata = $samlSettings->getSPMetadata();

I get an error: Error parsing metadata. Error parsing metadata from Saml2/Metadata.php:

        try {
			
            $xml = Utils::loadXML($xml, $metadata);
			
            if (!$xml) {
                throw new Exception('Error parsing metadata');
            }
        } catch (Exception $e) {
            throw new Exception('Error parsing metadata. '.$e->getMessage());
        }

Changing the & character with & fixes it, so it seems like this string wasn't being escaped properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant