Commit Graph

45 Commits

Author SHA1 Message Date
Andy Miller
ee8d783d05
better support for external urls in Utils::url() 2024-04-20 15:42:42 +01:00
Jeremy Angele
80ce87e4a9
Update dangerous extensions (#3756)
Thanks for this!
2023-10-24 10:20:22 +01:00
Andy Miller
93755c7329
fix UtilsTest for PHPUnit 10 2023-02-19 13:48:13 -07:00
Andy Miller
0abde01442
better fix 2022-03-05 09:22:12 -07:00
Andy Miller
03f71fa49d
rolled back but fixed the Utils::url() functionality 2022-03-04 15:37:03 -07:00
Andy Miller
b80fcca0cf
fixes for Utils::url() 2022-03-03 12:35:17 -07:00
Matias Griese
644a54e441 Added Utils::getPathFromToken() method which works also with Flex Objects 2021-03-17 21:54:26 +02:00
Pierre Joye
b20838531c Resolved merge conflict 2021-02-01 22:43:28 +07:00
Matias Griese
a8a960d10b Updated unit tests 2021-02-01 11:14:53 +02:00
Pierre Joye
10be5d5a7c fix text if language is found and is part as enabled languages 2021-01-31 07:14:33 +07:00
Pierre Joye
711d7b122d Add fixture for translatedLanguages 2021-01-30 21:22:39 +07:00
Matias Griese
f25ea8f056 Updated unit tests 2020-12-04 20:01:28 +02:00
Stephan Strate
ae6f0b5505 Check exact extension in checkFilename utility (#3061)
* Fix uploads_dangerous_extensions checking (#3060)
* Remove redundant prefixing of `.` to extension (#3060)
2020-11-17 13:07:33 +02:00
Patric Johansson
4bba284bf5 Update Core to follow PSR-2 standard 2019-10-15 13:33:48 +03:00
Matias Griese
69b39b4b21 Fixed multiple url() issues with streams
* Fixed `url()` returning wrong path if using stream with grav root path in it, eg: `user-data://shop` when Grav is in `/shop`
* Fixed `url()` not returning a path to non-existing file (`user-data://shop` => `/user/data/shop`) if it is set to fail gracefully
* Fixed `url()` returning false on unknown streams, such as `ftp://domain.com`, they should be treated as external URL
2019-06-28 13:36:37 +03:00
Andy Miller
d227a82056
Fixed regresssion issue of Utils::Url() not returning false on failure #2524 2019-05-27 11:58:53 +03:00
Andy Miller
40563ed2f8
Better Utils::normalizePath() logic #2216 2019-04-13 12:21:54 -06:00
Andy Miller
ef7b33f9b6
Fixed issue with Utils::normalizePath messing with external URLs #2216 2019-04-12 07:55:51 -06:00
Andy Miller
66bba376db
minor fixes and tests for Utils::url 2019-04-11 07:30:12 -06:00
Andy Miller
8512968726
this closes #2432 2019-04-05 17:38:45 -06:00
Andy Miller
397f6902f3
Improved Utils::normalizePath() to support non-protocol URLs 2019-04-03 16:52:52 -06:00
Andy Miller
c653fe6e4a
multibyte and case insensitivity support in Util string functions 2018-11-27 16:39:30 -07:00
Andy Miller
08cb311e5e
Fix truncator tests 2018-08-06 15:36:38 -06:00
Davide Liessi
a1abcfd067 Move fix for #1114 to Truncator::truncateLetters (#2004)
* Move fix for #1114 to Truncator::truncateLetters

The original fix provided by #1125 in Utils::truncateHtml compared the
summary size with the full HTML string length.
Thus, the string was still being truncated (and the HTML rewritten) even
when only the HTML string length, and not the text length, exceeded the
summary size.

* Add fix for #1114 also to Truncator::truncateWords
2018-05-15 11:38:48 -06:00
Gabriel Caruso
f261173de2 Refactoring tests (#1779) 2018-01-19 11:15:20 -07:00
Adam Roe
cd15b9197b Don't truncate HTML if content length is less than summary size (#1125), fixes #1114 2016-10-25 16:25:56 +02:00
Andy Miller
c6f8fe259a Removed duplicate method Grav::mime() and used existing (renamed) Utils::getMimeByExtension(), also added Utils::getExtensionByMime() 2016-10-01 17:16:35 -06:00
Andy Miller
a54f30b8ae Revamped the Html Truncator code to address issues with invalid HTML #1019 2016-09-06 15:38:36 -06:00
Andy Miller
78891add6a setDotNotation() Test added 2016-05-25 11:12:56 -06:00
Andy Miller
892fb83a32 Replace remove with dotNotation() methods 2016-05-25 11:05:52 -06:00
Flavio Copes
6791244e38 Merge branch 'develop' into feature/reset-grav-every-test 2016-02-25 16:52:56 +01:00
Flavio Copes
a683f661ed Add truncate and truncateHtml tests for input type 2016-02-15 14:39:28 +01:00
Flavio Copes
1c382a1bc6 Fix assertEquals parameters order 2016-02-15 14:39:03 +01:00
Flavio Copes
54f959b462 Reinitialize Grav on every test
Don't need to worry about changing configuration or pages or anything
in a test, every test method will start with a clean slate
2016-02-04 14:12:27 +01:00
Flavio Copes
9d67f1ac33 Fix assertSame param order 2016-02-01 18:55:33 +01:00
Flavio Copes
c307f63e1f Cleanup tests 2016-01-29 18:32:52 +01:00
Flavio Copes
1494247c85 Tests code cleanup 2016-01-29 18:32:52 +01:00
Flavio Copes
c43f253805 Fix testPathPrefixedByLangCode test 2016-01-10 19:10:32 +01:00
Flavio Copes
756e2cf0c3 Fix spacing 2016-01-10 19:10:21 +01:00
Flavio Copes
c772c2d4ad Finish up Utils testing 2016-01-07 17:38:25 +01:00
Flavio Copes
5fefa85f4a More tests 2016-01-07 14:33:18 +01:00
Flavio Copes
e8a935570b More tests 2016-01-07 13:58:47 +01:00
Flavio Copes
90d2856581 Add a test that uses $grav 2016-01-06 17:30:39 +01:00
Flavio Copes
e180e5a52a Add some more tests 2016-01-06 16:33:58 +01:00
Flavio Copes
f1ac509032 Structure tests in folders that resemble the Grav system/src folder 2016-01-05 19:50:07 +01:00