1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-02-07 12:28:28 +01:00
No description
Find a file
Andre Klapper 89be7a51d8 Validate some user provided calendar query range dates
Summary:
Calendar search form allows users to define date ranges. Entering gibberish data leads to a cryptic exception due to calling `format()` on `null`, as `AphrontFormDateControlValue::getDateTime()` can return `null` instead of a `DateTime` object.

Also add some additional PhpDoc as a result of playing with this code.

Note that other calendar query forms are more lenient and still accepts gibberish after applying this patch. The intention behind this patch is replacing a cryptic exception with a more appropriate and descriptive error; this patch does not attempt to introduce validation everywhere.

```
EXCEPTION: (Error) Call to a member function format() on null at [<phorge>/src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php:469]
```

Closes T15943

Test Plan:
* On http://phorge.localhost/calendar/query/month/, click "Edit Query", check "Occurs After", replace default date value with "abcde", click "Search" button
* On http://phorge.localhost/calendar/query/month/, click "Edit Query", check "Occurs After", replace default time value with "abcde", click "Search" button
* On http://phorge.localhost/calendar/query/month/, click "Edit Query", check "Occurs Before", replace default date value with "abcde", click "Search" button
* On http://phorge.localhost/calendar/query/month/, click "Edit Query", check "Occurs Before", replace default time value with "abcde", click "Search" button
* On http://phorge.localhost/calendar/query/day/, click "Edit Query", check "Occurs After", replace default date value with "abcde", click "Search" button
* On http://phorge.localhost/calendar/query/day/, click "Edit Query", check "Occurs After", replace default time value with "abcde", click "Search" button
* On http://phorge.localhost/calendar/query/day/, click "Edit Query", check "Occurs Before", replace default date value with "abcde", click "Search" button
* On http://phorge.localhost/calendar/query/day/, click "Edit Query", check "Occurs Before", replace default time value with "abcde", click "Search" button

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15943

Differential Revision: https://we.phorge.it/D25825
2024-11-26 15:12:22 +01:00
bin Remove the "ssh-auth-key" script 2019-10-28 17:52:37 -07:00
conf Change some instances of "phabricator" to "phorge" 2023-11-18 22:14:15 +00:00
externals mimemailparser: Fix implicitly nullable parameter declarations for PHP 8.4 2024-11-26 15:02:10 +01:00
resources Fix submitting forms in a new tab using Ctrl+Return 2024-11-25 21:09:36 +11:00
scripts Update mimemailparser from May 2011 version to 8.0.4 2024-11-01 08:59:05 +01:00
src Validate some user provided calendar query range dates 2024-11-26 15:12:22 +01:00
support Bump PHP version requirement from 5.2.3 to 7.2.25 2024-10-18 14:20:21 +02:00
webroot Fix submitting forms in a new tab using Ctrl+Return 2024-11-25 21:09:36 +11:00
.arcconfig T15006: Update .arcconfig to point to we.phorge.it 2021-06-18 14:51:47 -04:00
.arclint Calendar Import: add unit tests to cover participants 2024-08-28 09:31:18 +02:00
.arcunit Use the configuration driven unit test engine 2015-08-11 07:57:11 +10:00
.editorconfig Fix text lint issues 2015-02-12 07:00:13 +11:00
.gitignore Generate Diviner book for Javelin 2023-08-30 11:20:12 -07:00
LICENSE Fix text lint issues 2015-02-12 07:00:13 +11:00
NOTICE Remove some "Phacility" and "epriestley" references 2021-07-08 10:46:17 -07:00
README.md Update Readme 2021-06-18 11:36:31 -04:00

Phorge is a collection of web applications which help software companies build better software.

Phorge is a community-maintained fork of Phabricator.

Phorge includes applications for:

  • reviewing and auditing source code;
  • hosting and browsing repositories;
  • tracking bugs;
  • managing projects;
  • conversing with team members;
  • assembling a party to venture forth;
  • writing stuff down and reading it later;
  • hiding stuff from coworkers; and
  • also some other things.

Phorge is developed and maintained by The Phorge Team.


LICENSE

Phorge is released under the Apache 2.0 license except as otherwise noted.