Plugin Directory

Changeset 661179


Ignore:
Timestamp:
01/30/2013 10:16:42 AM (13 years ago)
Author:
surdotly
Message:

SDK up, fixed notices

Location:
surly/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • surly/trunk/lib/Surly.php

    r658049 r661179  
    633633        }
    634634
    635         public function _performRequest($url, $method = 'GET', $params = null)
     635        function _performRequest($url, $method = 'GET', $params = null)
    636636        {
    637637            if (function_exists('curl_init')) {
  • surly/trunk/readme.txt

    r658049 r661179  
    2828== Changelog ==
    2929
     30= 1.0.2 =
     31
     32* Updated Sur.ly SDK
     33* Fixed notices in admin
     34
    3035= 1.0.1 =
    3136
    32 Updated Sur.ly SDK
     37* Updated Sur.ly SDK
    3338
    3439= 1.0 =
  • surly/trunk/surly.php

    r658049 r661179  
    2020 * Plugin URI: http://sur.ly
    2121 * Description: Protection of outbound links
    22  * Version: 1.0
     22 * Version: 1.0.1
    2323 * Author: Sur.ly
    2424 */
     
    9797if (isset($_POST['save_changes']))
    9898{
    99     update_option('user_list', $_POST['user_list']);
     99    if (isset($_POST['user_list'])) {
     100        update_option('user_list', $_POST['user_list']);
     101    }
     102   
    100103    foreach ($_POST['urls'] as $key => $v)
    101104    {
     
    106109    }
    107110    update_option('urls', $_POST['urls']);
    108     update_option('replace_in_posts', $_POST['replace_in_posts']);
    109     update_option('shorten_urls', $_POST['shorten_urls']);
    110     update_option('settings', $_POST['settings']);
    111    
     111   
     112    if (isset($_POST['replace_in_posts'])) {
     113        update_option('replace_in_posts', $_POST['replace_in_posts']); 
     114    }
     115    else {
     116        update_option('replace_in_posts', 0);
     117    }
     118   
     119    if (isset($_POST['shorten_urls'])) {
     120        update_option('shorten_urls', $_POST['shorten_urls']);
     121    }
     122    else {
     123        update_option('shorten_urls', 0);
     124    }
     125   
    112126    if ($_POST['settings'] == 'tab1')
    113127    {
     
    118132        }       
    119133    }
    120     elseif ($_POST['settings'] == 'tab2' AND $_POST['settings_id'] != '')
     134    elseif ($_POST['settings'] == 'tab2' && isset($_POST['settings_id']) && $_POST['settings_id'] != '')
    121135    {
    122         update_option('settings_id', $_POST['settings_id']);
     136        update_option('settings_id', $_POST['settings_id']);
    123137    }
    124138}
     
    156170                    ?>
    157171                    <div class="input_box">
    158                         <input type="text" id="appendedInputButtons" name="urls[]" value="<?php echo $v;?>">
     172                        <input type="text" id="appendedInputButtons" name="urls[]">
    159173                        <button type="button" class="button" onclick="delblockurl(this);">Remove</button>
    160174                        <button type="button" class="button" onclick="addblockurl(this);">Add domain</button>
     
    288302    function cacheShortIds($url2shortIds)
    289303    {
     304        if (!$url2shortIds) {
     305            return;
     306        }
     307       
    290308        global $wpdb; $insert = array();
    291309        $page_is_cache_table = $wpdb->prefix.'shortener_cache';
     
    303321    function getCachedShortIds($urls)
    304322    {
     323        if (!$urls) {
     324            array();
     325        }
     326       
    305327        global $wpdb;
    306328        $where = array();
Note: See TracChangeset for help on using the changeset viewer.