-
Notifications
You must be signed in to change notification settings - Fork 238
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
is_file check on html #307
Comments
For now; if anyone is interested; this is my work-around;
|
It's tricky. We simply can't know, that what you passed is some static text or a file name. Using |
We could maybe add another check for HTML via the Regex we already have. This would at least help in the cases, where a full HTML document is passed. |
Isn't the |
Yeah, your're probably right. It's been a while since I wrote this. I'll try to modify things a little and find better method names. Will let you know when I've updated it. It would be great if you could then help testing. |
Thanks! and off course! |
@blaaat I've created a MR with my refactorings, see the comments there. Could you give it a try? As a side note: This changes the default behavior. Since we follow Semver this change will probably also require another major release. |
Thanks, I'll and let you know. The
I'd prefer the old regex (maybe even with a ^prefixed) |
Fixes my problem! Thanks.
I think it isn't necessary to change default behavior and still fix the problem. An extra regex (prefixed with ^) won't affect any path's, because I don't think a filesystem exists that allows a path starting with <html or <doctype |
Good point, thanks. I somehow assumed Right now it tries to stay away from
See the updated MR here: #308 Maybe you can take another look? |
Looks good and works perfect! Thanks.
Nice solution! |
Issue #307 Refactor check for temp file creation
Great. Just released 2.4.0 including this change. Thanks for your help! |
PHP Warning is_file(): open_basedir restriction in effect. File(<!DOCTYPE HTML>
<html>
phpwkhtmltopdf/src/Pdf.php:325 mikehaertl\wkhtmlto\Pdf::processOptions
On my production machine (CentOS7; PHP 7.2) PHP_MAXPATHLEN is quite high. Somehow the html header-footer-html triggers the openbase_dir error in the is_file call.
Maybe better to do the other checks (html/xml/url regex or strip_tags) before the is_file call?
The text was updated successfully, but these errors were encountered: