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

Add condition to avoid warning on calling file_exists() #2176

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/internal/Magento/Framework/Config/Dom.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,8 @@ public static function validateDomDocument(
$schema = self::$urnResolver->getRealPath($schema);
libxml_use_internal_errors(true);
try {
if (file_exists($schema)) {
// 4096 is the maximum length allowed by file_exists for the filename
if (strlen($schema) < 4096 && file_exists($schema)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code will be removed, so the fix will not be required.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes ok. But actually it doesn't work. So… If I put myself at the same point of view as you… Why not merging this and removing the code after? You just said you will remove it. But fixing problems until then is still a good idea, isn't it?

Seems to be a good idea, isn't it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean it's already removed and will be published with next publication. Merging this PR will just cause extra conflict.

$result = $dom->schemaValidate($schema);
} else {
$result = $dom->schemaValidateSource($schema);
Expand Down