Plugin Directory

Changeset 840303


Ignore:
Timestamp:
01/17/2014 12:56:15 PM (12 years ago)
Author:
zephilou
Message:

[fix] add data validation

Location:
cyklodev-wp-settings/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cyklodev-wp-settings/trunk/index.php

    r839783 r840303  
    66Description: Cyklodev Wordpress Settings
    77Author: Zephilou
    8 Version: 1.1.0
     8Version: 1.1.1
    99Author URI: http://www.cyklodev.com
    1010*/
     
    3030    'cyklodev_settings_login_email'         => 'Login with email',
    3131    'cyklodev_settings_update_notification' => 'Update notification',
    32     'cyklodev_settings_update_auto'         => 'Automatic update',
     32    'cyklodev_settings_update_auto'         => 'Automatic update'
    3333);
    3434
     
    109109    define (WP_AUTO_UPDATE_CORE,false);
    110110}
    111 
    112 
    113 
    114111?>
  • cyklodev-wp-settings/trunk/readme.txt

    r839783 r840303  
    55Requires at least: 3.0.1
    66Tested up to: 3.8
    7 Stable tag: 1.1.0
     7Stable tag: 1.1.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    3636== Changelog ==
    3737
     38= 1.1.1 =
     39* Add data validation to avoid unwanted entries in db
     40
    3841= 1.1.0 =
    3942* Add automatic update enabler/disabler
  • cyklodev-wp-settings/trunk/views/settings.php

    r839783 r840303  
    44
    55$options_list = array (
    6     'cyklodev_settings_rss'                 => 'Rss',
    7     'cyklodev_settings_login_email'         => 'Login with email',
    8     'cyklodev_settings_update_notification' => 'Update notification',
    9     'cyklodev_settings_update_auto'         => 'Automatic update',
     6    'cyklodev_settings_rss'                     => 'Rss',
     7    'cyklodev_settings_login_email'             => 'Login with email',
     8    'cyklodev_settings_update_notification'     => 'Update notification',
     9    'cyklodev_settings_update_auto'             => 'Automatic update'
    1010);
    1111
    1212foreach ($options_list as $k => $v) {
    13     if (isset($_POST[$k])){   
    14         update_option($k,$_POST[$k]);
    15         echo '<div style="background-color:#00ff00;" align="center">Updated !</div>';
    16         @header(Location);
     13    if (isset($_POST[$k])){ 
     14        if($_POST[$k] == 'enable' || $_POST[$k] == 'disable'){
     15            update_option($k,$_POST[$k]);
     16            echo '<div style="background-color:#00ff00;" align="center">Updated !</div>';
     17            @header(Location);
     18        } else {
     19            echo '<div style="background-color:#ff0000;" align="center">Nice try but data not allowed !</div>';
     20        }
    1721    }
    1822}
Note: See TracChangeset for help on using the changeset viewer.