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

Match namespace in XML file with namespace in XSD file #10828

Merged
merged 1 commit into from
Jul 9, 2023

Conversation

greg0ire
Copy link
Member

@greg0ire greg0ire commented Jul 9, 2023

In #8791, a global search and replace was used for http and https.
This broke the documentation examples in that as soon as you turn on XSD validation, it will fail because the namespace in the XML file does not match the ones defined in the XSD file, which do not exhibit the https.

Note that this is not a security concern, because these URIs are not meant to be actually resolved, but to serve as a unique identifier for the namespace in which we define our elements.

In 7fa3e6e, a global search and replace
was used for http and https.
This broke the documentation examples in that as soon as you turn on XSD
validation, it will fail because the namespace in the XML file does not
match the ones defined in the XSD file, which do not exhibit the https.

Note that this is not a security concern, because these URIs are
not meant to be actually resolved, but to serve as a unique identifier
for the namespace in which we define our elements.
@greg0ire
Copy link
Member Author

greg0ire commented Jul 9, 2023

The docs job error should be handled by #10824 and phpDocumentor/guides#486

@derrabus
Copy link
Member

derrabus commented Jul 9, 2023

Is there a way to actually migrate towards HTTPS? I understand that the documentation is not correct, but it feels like it should be. 🙈

@greg0ire
Copy link
Member Author

greg0ire commented Jul 9, 2023

Is there a way to actually migrate towards HTTPS? I understand that the documentation is not correct, but it feels like it should be.

Why would we want to? If you browse the URLs modified here, you will get 404s. They're not really URLs, they're more like unique identifiers that mention http://doctrine-project.org because we own that domain, so it's a good way to make the string unique. If you want the migration towards HTTPS in order to avoid well-meaning people to make the same mistake again and change the documentation to something wrong, then I'm afraid I don't see a good way to do that. We'd have to have an alternate XSD file, and to somehow use one or the other depending on the incoming XML file. Sounds like a lot of effort for not much.

@greg0ire greg0ire added this to the 2.15.4 milestone Jul 9, 2023
@greg0ire greg0ire merged commit ec7a8a7 into doctrine:2.15.x Jul 9, 2023
@greg0ire greg0ire deleted the matching-xml branch July 9, 2023 21:02
@Greg0
Copy link
Contributor

Greg0 commented Jul 10, 2023

What about differences in XSD files

There are pointing to different protocols (HTTP/HTTPS)

Also opening unsecured http://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd redirects now to HTTPS

@greg0ire
Copy link
Member Author

Maybe the best would be to use vendor/doctrine/orm/doctrine-mapping.xsd in the XML files instead. Doctrine uses that itself internally:

if (! $document->schemaValidate(__DIR__ . '/../../../../../doctrine-mapping.xsd')) {
throw MappingException::fromLibXmlErrors(libxml_get_errors());
}

So I think the only thing calling https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd might be IDEs, but I use Neovim without a plugin doing such a thing, so I wouldn't know. I wonder what is happening for PHPStorm users. Are they getting errors about invalid XML files?

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

Successfully merging this pull request may close these issues.

3 participants