Skip to content
Snippets Groups Projects
Commit bd062f56 authored by Grzegorz Rola's avatar Grzegorz Rola
Browse files

Merge branch 'feature/sanitization' into 'master'

Added sanitization on posted AJAX data

See merge request !17
parents fe4d0a5f be594106
No related branches found
No related tags found
1 merge request!17Added sanitization on posted AJAX data
Pipeline #10645 passed with stages
in 3 minutes and 46 seconds
variables: variables:
DISABLE_FUNCTIONAL: 1 DISABLE_FUNCTIONAL: 1
DISABLE_ACCEPTANCE: 1 DISABLE_ACCEPTANCE: 1
DISABLE_CODECEPTION: 1
IS_LIBRARY: 1 IS_LIBRARY: 1
include: 'https://gitlab.com/wpdesk/gitlab-ci/raw/master/gitlab-ci-1.2.yml' include: 'https://gitlab.com/wpdesk/gitlab-ci/raw/master/gitlab-ci-1.2.yml'
......
## [3.1.2] - 2020-03-05
### Added
- sanitization on posted AJAX data
## [3.1.1] - 2019-07-30 ## [3.1.1] - 2019-07-30
### Fixed ### Fixed
- Security for templates as side effect is generated there. Also required for prefixer compatibility - Security for templates as side effect is generated there. Also required for prefixer compatibility
......
...@@ -82,10 +82,10 @@ class AjaxHandler implements HookablePluginDependant ...@@ -82,10 +82,10 @@ class AjaxHandler implements HookablePluginDependant
public function processAjaxNoticeDismiss() public function processAjaxNoticeDismiss()
{ {
if (isset($_POST[self::POST_FIELD_NOTICE_NAME])) { if (isset($_POST[self::POST_FIELD_NOTICE_NAME])) {
$noticeName = $_POST[self::POST_FIELD_NOTICE_NAME]; $noticeName = sanitize_text_field($_POST[self::POST_FIELD_NOTICE_NAME]);
if (isset($_POST[self::POST_FIELD_SOURCE])) { if (isset($_POST[self::POST_FIELD_SOURCE])) {
$source = $_POST[ self::POST_FIELD_SOURCE ]; $source = sanitize_text_field($_POST[ self::POST_FIELD_SOURCE ]);
} else { } else {
$source = null; $source = null;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment