Plugin Directory

Changeset 414224


Ignore:
Timestamp:
07/23/2011 01:58:22 PM (15 years ago)
Author:
Beaver6813
Message:

2.0b2.110723

  • Improved escaping on settings to allow greater flexibility.
  • Fixed issue with jQuery not loading if WP version is up to date.
  • Fixed issue with plugin showing twice on plugin list.
Location:
infinite-scroll/branches/Beta
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • infinite-scroll/branches/Beta/infinitescroll.init.js.php

    r411180 r414224  
    11<?php
    2 /*
    3 Plugin Name: Infinite Scroll
    4 Version: 2.0b2.110716
    5 Plugin URI: http://www.infinite-scroll.com
    6 Description: Automatically loads the next page of posts into the bottom of the initial page.
    7 Author: Beaver6813, dirkhaim, Paul Irish
    8 Author URI: http://www.infinite-scroll.com
    9 License   : http://creativecommons.org/licenses/GPL/2.0/
    10 */
    11 define('infscr_version'     ,   '2.0b2.110716');
     2define('infscr_version'     ,   '2.0b2.110723');
    123
    134header('Content-Type: application/javascript');
     
    3122"; 
    3223    }
    33 
     24function slashOnlyDouble($text)
     25    {
     26    return addcslashes(stripslashes($text), '"');
     27    }
     28   
    3429//Get pathParse and validate it.
    3530$error = false;
     
    5550    $loading_image      = $scheme.$noscheme['host'].$noscheme['path']; 
    5651   
    57     $loading_text       = stripslashes(get_option("infscr_text"));
    58     $donetext           = stripslashes(get_option("infscr_donetext"));
     52    $loading_text       = slashOnlyDouble(get_option("infscr_text"));
     53    $donetext           = slashOnlyDouble(get_option("infscr_donetext"));
    5954    $content_selector   = stripslashes(get_option("infscr_content_selector"));
    6055    $navigation_selector= stripslashes(get_option("infscr_nav_selector"));
  • infinite-scroll/branches/Beta/readme.txt

    r411053 r414224  
    4949
    5050== Changelog ==
     51= 2.0b2.110723 =
     52* Improved escaping on settings to allow greater flexibility.
     53* Fixed issue with jQuery not loading if WP version is up to date.
     54* Fixed issue with plugin showing twice on plugin list.
     55
    5156= 2.0b2.110716 =
    5257* Moved init script from direct page insertion to seperate script.
  • infinite-scroll/branches/Beta/wp_infinite_scroll.php

    r411180 r414224  
    22/*
    33Plugin Name: Infinite Scroll
    4 Version: 2.0b2.110716
     4Version: 2.0b2.110723
    55Plugin URI: http://www.infinite-scroll.com
    66Description: Automatically loads the next page of posts into the bottom of the initial page.
     
    99License   : http://creativecommons.org/licenses/GPL/2.0/
    1010*/
    11 define('infscr_version'     ,   '2.0b2.110716');
     11define('infscr_version'     ,   '2.0b2.110723');
    1212// constants for enables/disabled
    1313define('infscr_enabled'     , 'enabled');
     
    4242
    4343// adding actions
    44 add_action('template_redirect'  , 'wp_inf_scroll_pre_init');
     44add_action('template_redirect'  , 'wp_inf_scroll_init');
    4545add_action('admin_menu'         , 'add_wp_inf_scroll_options_page');
    4646add_action("wp"                 , 'wp_inf_scroll_404');
     
    4949    add_action('admin_notices', 'wp_inf_scroll_setup_warning');
    5050
    51 function wp_inf_scroll_pre_init($wp)
     51function wp_inf_scroll_jquery()
    5252    {
    5353    global $wp_scripts;
     
    6969        else
    7070            wp_register_script( 'jquery', plugins_url('infinite-scroll')."/js/jquery-1.6.2.min.js", array(), '1.6.2', false );
    71         wp_enqueue_script( 'jquery' ); 
    7271        }
    73     wp_inf_scroll_init();
     72    wp_enqueue_script( 'jquery' );
     73    return true;   
    7474    }
    7575/*
     
    8585        }
    8686    }
    87 
    8887function add_wp_inf_scroll_options_page()
    8988    {
     
    151150function wp_inf_scroll_init()
    152151    {
    153     global $user_level;
     152    global $user_level,$wp_query;
    154153    $load_infinite_scroll = true;   
    155154    /* Lets start our pre-flight checks */
    156     if (get_option(key_infscr_state) == infscr_disabled || (is_page() || is_single()) || (get_option(key_infscr_state) == infscr_maint && $user_level >= 8) || (get_option(key_infscr_state) == infscr_config && $user_level <= 8) || (!have_posts()))
     155    if (get_option(key_infscr_state) == infscr_disabled || is_page() || is_single() || (get_option(key_infscr_state) == infscr_maint && $user_level >= 8) || (get_option(key_infscr_state) == infscr_config && $user_level <= 8) || !have_posts())
    157156        $load_infinite_scroll = false;
    158157       
     
    168167        if ( !$max_page || $max_page >= $nextpage )
    169168            {
     169            wp_inf_scroll_jquery();
    170170            //We have to pass pathInfo to the script as the script can't determine the path itself.
    171171            //We have to introduce some form of validation, so we can validate/sign the pathInfo we create.
     
    191191        if ($infscr_state != infscr_enabled && $infscr_state != infscr_disabled && $infscr_state != infscr_maint && $infscr_state != infscr_config)
    192192            $infscr_state = infscr_state_default;
    193         update_option(key_infscr_state, $infscr_state);
     193        update_option(key_infscr_state, esc_js($infscr_state));
    194194
    195195        // update debug
    196196        $infscr_debug = $_POST[key_infscr_debug];
    197         update_option(key_infscr_debug, $infscr_debug);
     197        update_option(key_infscr_debug, esc_js($infscr_debug));
    198198       
    199199        // update js calls field
     
    231231        // update content selector
    232232        $content_selector = $_POST[key_infscr_content_selector];
    233         update_option(key_infscr_content_selector, $content_selector);
     233        update_option(key_infscr_content_selector, esc_js($content_selector));
    234234
    235235        // update the navigation selector
    236236        $navigation_selector = $_POST[key_infscr_nav_selector];
    237         update_option(key_infscr_nav_selector, $navigation_selector);
     237        update_option(key_infscr_nav_selector, esc_js($navigation_selector));
    238238
    239239        // update the post selector
    240240        $post_selector = $_POST[key_infscr_post_selector];
    241         update_option(key_infscr_post_selector, $post_selector);
     241        update_option(key_infscr_post_selector, esc_js($post_selector));
    242242
    243243        // update the next selector
    244244        $next_selector = $_POST[key_infscr_next_selector];
    245         update_option(key_infscr_next_selector, $next_selector);
     245        update_option(key_infscr_next_selector, esc_js($next_selector));
    246246
    247247
     
    441441                <td>
    442442                    <?php
    443                         echo "<input name='".key_infscr_text."' id='".key_infscr_text."' value='".stripslashes(get_option(key_infscr_text))."' size='30' type='text'>\n";
     443                        echo "<textarea name='".key_infscr_text."' id='".key_infscr_text."' rows='2'  style='width: 95%;'>\n";
     444                        echo stripslashes(get_option(key_infscr_text));
     445                        echo "</textarea>\n";
    444446                    ?>
    445447                </td>
     
    455457                <td>
    456458                    <?php
    457                         echo '<input name="'.key_infscr_donetext.'" id="'.key_infscr_donetext.'" value="'.stripslashes(get_option(key_infscr_donetext)).'" size="30" type="text">';
     459                        echo "<textarea name='".key_infscr_donetext."' id='".key_infscr_donetext."' rows='2'  style='width: 95%;'>\n";
     460                        echo stripslashes(get_option(key_infscr_donetext));
     461                        echo "</textarea>\n";
    458462                    ?>
    459463                </td>
Note: See TracChangeset for help on using the changeset viewer.