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

Filter |stripHtml is not functional in latest version #252

Closed
Lumeriol opened this issue Jan 25, 2021 · 4 comments
Closed

Filter |stripHtml is not functional in latest version #252

Lumeriol opened this issue Jan 25, 2021 · 4 comments

Comments

@Lumeriol
Copy link

Version: 2.10

Bug Description

With new version of Latte there is a bug with filter stripHtml - when used, it show large stack trace in page instead of show classic Tracy with error, and exception file is created.

Fatal error:
Uncaught TypeError: is_file(): Argument #1 ($filename) must be of type string, null given in ...\vendor\tracy\tracy\src\Bridges\Nette\Bridge.php:73\n
Stack trace:\n
0 ...\vendor\tracy\tracy\src\Bridges\Nette\Bridge.php(73): is_file(NULL)\n
1 ...\vendor\tracy\tracy\src\Tracy\BlueScreen\BlueScreen.php(199): Tracy\Bridges\Nette\Bridge::renderLatteUnknownMacro(Object(Latte\CompileException))\n
2 ...\vendor\tracy\tracy\src\Tracy\BlueScreen\BlueScreen.php(156): Tracy\BlueScreen->renderActions(Object(Latte\CompileException))\n
3 ...\vendor\tracy\tracy\src\Tracy\BlueScreen\BlueScreen.php(100): Tracy\BlueScreen->renderTemplate(Object(Latte\CompileException), 'C:\localhost\we...')\n
4 ...\vendor\tracy\tracy\src\Tracy\Debugger\Debugger.php(327): Tracy\BlueScreen->render(Object(Latte\CompileException))\n
5 ...\vendor\tracy\tracy\src\Tracy\Debugger\Debugger.php(206): Tracy\Debugger::exceptionHandler(Object(Latte\CompileException))\n
6 [internal function]: Tracy\Debugger::Tracy{closure}(Object(Latte\CompileException))\n
7 {main}\n

Steps To Reproduce

{='<p>one &lt; two</p>'|stripHtml} or standard {$foo|stripHtml}
Tested on PHP 8.0.1 and latest versions of Nette packages.

Expected Behavior

Same behavior as in version 2.9

@sasule
Copy link

sasule commented Jan 25, 2021

I can confirm same behaviour with this config:
PHP 7.4.4, PHP8.0.1
Tracy: 2.8.2
Latte: 2.10.0

I've investigated a litte bit but if you patch argument of is_file() function and so on, you will get CompileException with information about wrong context "TEXT" (but expected "html", "xthml" and so on).

So I think it's somehow related to Tracy also.

dg added a commit that referenced this issue Jan 25, 2021
Also reverts "FilterInfo: default $contentType is CONTENT_TEXT"

This reverts commit 04c8aee.
@dg
Copy link
Member

dg commented Jan 25, 2021

Fixed

@dg dg closed this as completed Jan 25, 2021
dg added a commit that referenced this issue Jan 25, 2021
Also reverts "FilterInfo: default $contentType is CONTENT_TEXT"

This reverts commit 04c8aee.
@kuty
Copy link

kuty commented Jan 26, 2021

when the fix will be released please?

@dg
Copy link
Member

dg commented Jan 26, 2021

Released in 2.10.1

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

No branches or pull requests

4 participants