File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change 1
1
<?php
2
-
3
2
/**
4
3
* Persist Admin notices Dismissal
5
4
*
19
18
* along with this program. If not, see <http://www.gnu.org/licenses/>.
20
19
*
21
20
* @package Persist Admin notices Dismissal
22
- * @author Collins Agbonghama
23
- * @author Andy Fragen
21
+ * @author Collins Agbonghama, Andy Fragen
24
22
* @license http://www.gnu.org/licenses GNU General Public License
25
23
*/
26
24
@@ -107,11 +105,11 @@ public static function load_script() {
107
105
* Uses check_ajax_referer to verify nonce.
108
106
*/
109
107
public static function dismiss_admin_notice () {
110
- $ option_name = sanitize_text_field ( $ _POST ['option_name ' ] );
111
- $ dismissible_length = sanitize_text_field ( $ _POST ['dismissible_length ' ] );
108
+ $ option_name = isset ( $ _POST [ ' option_name ' ] ) ? sanitize_text_field ( wp_unslash ( $ _POST ['option_name ' ] ) ) : '' ;
109
+ $ dismissible_length = isset ( $ _POST [ ' dismissible_length ' ] ) ? sanitize_text_field ( wp_unslash ( $ _POST ['dismissible_length ' ] ) ) : 0 ;
112
110
113
111
if ( 'forever ' !== $ dismissible_length ) {
114
- // If $dismissible_length is not an integer default to 1
112
+ // If $dismissible_length is not an integer default to 1.
115
113
$ dismissible_length = ( 0 === absint ( $ dismissible_length ) ) ? 1 : $ dismissible_length ;
116
114
$ dismissible_length = strtotime ( absint ( $ dismissible_length ) . ' days ' );
117
115
}
You can’t perform that action at this time.
0 commit comments