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

Standalone scanning of files via CLI throwns Uncaught Error: Class with XPath #43

Closed
30129071 opened this issue Jun 18, 2020 · 1 comment · Fixed by #57
Closed

Standalone scanning of files via CLI throwns Uncaught Error: Class with XPath #43

30129071 opened this issue Jun 18, 2020 · 1 comment · Fixed by #57

Comments

@30129071
Copy link

`php ../svg-sanitizer/src/svg-scanner.php "../myTestSVG.svg"

Fatal error: Uncaught Error: Class 'enshrined\svgSanitize\data\XPath' not found in C:\svg-sanitizer\src\Sanitizer.php:214
Stack trace:
#0 C:\svg-sanitizer\src\svg-scanner.php(126): enshrined\svgSanitize\Sanitizer->sanitize('<?xml version="...')
#1 {main}
thrown in C:\svg-sanitizer\src\Sanitizer.php on line 214`

I've used different versions from version 11 to 13.3 and they all produce this error, I have also tried reinstall the package via composer but still receive the same error.

@ohader
Copy link
Contributor

ohader commented Aug 8, 2021

Standalone scanner does not rely on Composer autoload. That's why new .../data/XPath.php needs to be added to the require section as well, see https://github.com/darylldoyle/svg-sanitizer/blob/master/src/svg-scanner.php#L11-L15

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 a pull request may close this issue.

2 participants