PluginProbe
Insert Html Snippet / trunk
Insert Html Snippet vtrunk
1.4.6 trunk 1.0 1.0.1 1.1 1.1.1 1.2 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.3 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.4 1.4.1 1.4.2 1.4.3 All 27 releases
← All changes | admin/snippet-delete.php +20 -20 1.0.1trunk View file →
@@ -1,28 +1,28 @@
1 1 <?php
2 +if ( ! defined( 'ABSPATH' ) )
3 + exit;
2 4 global $wpdb;
3 -
4 5 $_POST = stripslashes_deep($_POST);
5 6 $_GET = stripslashes_deep($_GET);
6 -
7 7 $xyz_ihs_snippetId = intval($_GET['snippetId']);
8 8 $xyz_ihs_pageno = intval($_GET['pageno']);
9 -
10 -if($xyz_ihs_snippetId=="" || !is_numeric($xyz_ihs_snippetId)){
11 - header("Location:".admin_url('admin.php?page=insert-html-snippet-manage'));
12 - exit();
13 -
14 -}
15 -$snippetCount = $wpdb->query( 'SELECT * FROM '.$wpdb->prefix.'xyz_ihs_short_code WHERE id="'.$xyz_ihs_snippetId.'" LIMIT 0,1' ) ;
16 -
17 -if($snippetCount==0){
18 - header("Location:".admin_url('admin.php?page=insert-html-snippet-manage&xyz_ihs_msg=2'));
19 - exit();
20 -}else{
21 -
22 - $wpdb->query( 'DELETE FROM '.$wpdb->prefix.'xyz_ihs_short_code WHERE id="'.$xyz_ihs_snippetId.'" ' ) ;
23 -
24 - header("Location:".admin_url('admin.php?page=insert-html-snippet-manage&xyz_ihs_msg=3&pagenum='.$xyz_ihs_pageno));
25 - exit();
26 -
9 +if (! isset( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'ihs-del_'.$xyz_ihs_snippetId )) {
10 + wp_nonce_ays( 'ihs-del_'.$xyz_ihs_snippetId );
11 + exit;
12 +}
13 +else {
14 + if($xyz_ihs_snippetId=="" || !is_numeric($xyz_ihs_snippetId)){
15 + wp_safe_redirect(admin_url('admin.php?page=insert-html-snippet-manage'));
16 + exit();
17 + }
18 + $snippetCount = $wpdb->query($wpdb->prepare( 'SELECT * FROM '.$wpdb->prefix.'xyz_ihs_short_code WHERE id=%d LIMIT 0,1',$xyz_ihs_snippetId )) ;
19 + if($snippetCount==0){
20 + wp_safe_redirect(admin_url('admin.php?page=insert-html-snippet-manage&xyz_ihs_msg=2'));
21 + exit();
22 + }else{
23 + $wpdb->query($wpdb->prepare( 'DELETE FROM '.$wpdb->prefix.'xyz_ihs_short_code WHERE id=%d',$xyz_ihs_snippetId)) ;
24 + wp_safe_redirect(admin_url('admin.php?page=insert-html-snippet-manage&xyz_ihs_msg=3&pagenum='.$xyz_ihs_pageno));
25 + exit();
26 + }
27 27 }
28 28 ?>