Commit Graph

26 Commits

Author SHA1 Message Date
DualFroz 5805bc7620 Stop output buffer cleanup at buffers that cannot be removed
zlib.output_compression makes its buffer non-removable once it has sent
compressed output, so ob_end_clean() raised a notice that replaced the
original exception. Fixes #704.
2026-10-02 16:11:20 +02:00
Denis Sokolov baec851ad6 Escape some HTML values that were not escaped 2026-09-18 12:00:00 +00:00
DualFroz b6b679db7d fix(template-helper): restrict escapeButPreserveUris to http/https schemes
escapeButPreserveUris() matched any scheme via [A-z]+?://, which also
turns javascript://, vbscript:// and data:// URIs into clickable links
on the generated error page, allowing script execution on click (XSS).
The [A-z] class was also invalid, spanning extra ASCII punctuation.

Restrict the scheme to http/https, the only two schemes that make
sense to linkify on an error page, leaving other schemes as plain
escaped text.
2026-09-04 22:16:53 +02:00
Dan Wallis 26c4ca5eb7 Fix tests 2021-04-14 22:48:03 +01:00
Dan Wallis 04116f5017 Avoid redirects away from error page 2021-04-14 22:14:24 +01:00
Graham Campbell e82fa73c0e Fixed tests 2020-10-09 23:44:52 +01:00
Glendon Solsberry 9b40477a11 Switch from div to span to allow copy and paste 2018-03-08 09:10:39 -05:00
Denis Sokolov 80e1be87b6 Merge pull request #528 from MarioBlazek/phpunit_forward_compatibility_layer
Use namespaced version of PHPUnit's TestCase
2017-11-03 21:03:30 +02:00
Markus Staab 9e7c2ea58c Prevent possible XSS via target="_blank" urls (#533) 2017-10-10 13:00:26 +03:00
Mario Blažek 4028b3baf5 Use namespaced version of PHPUnit's TestCase 2017-09-29 09:41:54 +02:00
Gregor Harlan d2829561ca allow to change the application root path 2017-02-18 13:47:11 +01:00
Luis Henrique Mulinari f553230e79 Add some tests 2016-10-23 18:20:00 -02:00
Andreas Möller c37aae68fe Fix: Use short array syntax 2016-07-24 19:36:49 +02:00
Denis Sokolov e18d217043 Add a workaround for dynamic default parameters in PHP 5.5 2016-01-23 23:01:04 +02:00
Guido Contreras Woda 30b6a3b264 Use a system facade to allow consumers of Whoops\Run to mock any system call that it would do through native functions. 2016-01-22 15:00:37 -03:00
Graham Campbell 0346c26963 CS fixes 2014-09-27 11:05:51 +01:00
John Long a1d1f5c10e Include exception code and, if applicable, error constant. 2014-05-24 20:06:50 -05:00
Denis Sokolov 70e23d1c52 TemplateHelper: improve invalid utf8 handling in hhvm 2014-03-31 07:21:53 +03:00
Denis 5f03095fae TemplateHelperTest: enable escabe broken utf8 for 5.3 2014-03-31 07:03:44 +03:00
Graham Campbell fe4666d6fa Skip on hhvm too 2014-03-30 18:30:28 +01:00
Denis Sokolov 35115f7e7f TemplateHelper: silent workaround for 5.3 for d76904a 2014-03-30 18:52:42 +02:00
Denis Sokolov d76904a0d8 TemplateHelper: fix escape with broken utf-8, close #163
If the source file that triggered an exception, had an illegal
UTF-8 sequence (because, for example, it wasn't UTF-8),
when PrettyPageHandler would try to show its source on the screen,
htmlspecialchars would return an empty string, resulting in no
source on the screen.

The workaround at least shows question marks instead of the original
characters. Guessing the correct encoding and reencoding that
to UTF-8 is too much bother at this point,
and the current approach still works well enough to see
where the error is coming from.
2014-03-30 18:39:42 +02:00
filp bcf5fdce7f Add TemplateHelper tests for variable handling 2013-06-25 11:47:16 +01:00
filp a03fbc6bf0 Add test for TemplateHelper::render 2013-06-24 23:53:45 +01:00
filp 88143a5734 Add test for TemplateHelper::slug 2013-06-24 23:43:18 +01:00
filp c68608ccc1 Move template helpers to own class 2013-06-24 23:41:00 +01:00