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

Allow the enabling of loading large files #98

Merged
merged 1 commit into from
Feb 22, 2024

Conversation

darylldoyle
Copy link
Owner

Provides a way to resolve #96

@@ -203,7 +226,7 @@ public function sanitize($dirty)
$this->resetInternal();
$this->setUpBefore();

$loaded = $this->xmlDocument->loadXML($dirty);
$loaded = $this->xmlDocument->loadXML($dirty, $this->getAllowHugeFiles() ? LIBXML_PARSEHUGE : 0);
Copy link

Choose a reason for hiding this comment

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

If I'm following correctly, by default we won't allow large files but others that are using this library (like the Safe SVG plugin) can utilize the setAllowHugeFiles method to turn that on?

Copy link
Owner Author

Choose a reason for hiding this comment

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

@dkotter that's correct, we're keeping the functionality the same by default, but allowing this to be enabled at runtime. This could likely be an admin option within Safe SVG ("Allow large SVG uploads?")

Copy link
Contributor

@ohader ohader left a comment

Choose a reason for hiding this comment

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

Looks good to me - having to opt-in explicitly for the new behavior. 👍

@darylldoyle darylldoyle merged commit 6a2c069 into master Feb 22, 2024
17 of 19 checks passed
@darylldoyle darylldoyle deleted the feature/load-huge-files branch February 22, 2024 17:51
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

Successfully merging this pull request may close these issues.

SVG files greater than 10Mb won't be sanitized
3 participants