Commit Graph

12 Commits

Author SHA1 Message Date
Michal Čihař
edd929216a Bring back token validation to GET requests
This is necessary to avoid CSRF on SQL queries. This is really more a
short term fix, proper fix (to be implemented in master) is to avoid
accepting SQL queries from GET requests.

This reverts commits:

* dae3390a02
* ea73fded71
* 90433788d6
* f797a8d87d
* 9c1cfc8553

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-12-14 17:27:22 +01:00
Michal Čihař
0b1c182703 Fix nested hidden inputs
We do not want to inject token there.

Fixes #12999

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-02-14 15:24:25 +01:00
Michal Čihař
d54061d1f8 Include token in hidden fields
This will fix few broken users:

- error reporting
- table search in navigation
- user preferences

Fixes #12964

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-02-13 12:53:36 +01:00
Michal Čihař
cdd5f7f6d3 Do not append ? at the URL if not needed
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-02-13 11:08:43 +01:00
Michal Čihař
3546bed47e Avoid using mb_strlen for checking whether string is empty
Using strlen produces same results here, just way faster.

Fixes #12397

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-16 10:29:21 +02:00
Deven Bansod
44760aca0b Use URL::getCommon() for all params to be included in the urls
Don't append the parameters in query string while building the HTML; was going awry when URL::getCommon() returned blank

Fix #12463
More instances of such appending of URL parameters which are present in the codebase,
have to fixed.

ChangeLog entry for #12463

Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
2016-08-17 12:13:44 +05:30
Michal Čihař
dae3390a02 Remove token from GET requests
The CSRF token really should be used only in POST requests. The reason
for that is that it's a bit harder to get to if it is in request body
(with POST) compared to GET request, where it is in the URL (being
easily available in server logs).

Also this will make the URLs look nicer ;-).

This change will definite break some functionality, but since #6297 most
of the code should be safe and remaining bugs can be fixed for upcoming
release.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-07-28 11:00:23 +02:00
Michal Čihař
6d8e1d7935 Merge branch 'QA_4_6' 2016-07-28 09:38:08 +02:00
Michal Čihař
dce94f229f More consistency for URL::getCommon
Now URL::getCommon always returns HTML encoded string, if you want
unencded one, use URL::getCommonRaw. This makes it easier to review the
code if uses correct variant.

Also I've fixed several wrong uses of the HTML encoded variant in
Location header.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-06-17 12:44:29 +02:00
Madhura Jayaratne
2a5f6acbee Class curly braces should be on the next line
Signed-off-by: Madhura Jayaratne <madhura.cj@gmail.com>
2016-02-23 22:34:32 +11:00
Madhura Jayaratne
c7063d2517 Add class doc blocks
Signed-off-by: Madhura Jayaratne <madhura.cj@gmail.com>
2016-02-23 22:32:05 +11:00
Durgesh
0b64827930 Refactored url parmeters generating, Issue #11990
Signed-off-by: Durgesh <007durgesh219@gmail.com>
2016-02-22 14:36:41 +05:30