WordPress.org

Plugin Directory

Changeset 524245


Ignore:
Timestamp:
03/27/12 09:24:15 (6 years ago)
Author:
SriniG
Message:

v1.5.5: security fixes, shortcode pagination fix, doc fix, l10n added in be_BY, el, et_EE, ro_RO

Location:
quotes-collection/trunk
Files:
8 added
3 edited

Legend:

Unmodified
Added
Removed
  • quotes-collection/trunk/quotes-collection-shortcodes.php

    r420481 r524245  
    7070 
    7171    if($orderby == 'id' || !$orderby) $orderby = 'quote_id'; 
     72    else if ($orderby == 'date_added') $orderby = 'time_added'; 
    7273    else if($orderby == 'random' || $orderby == 'rand') { 
    7374        $orderby = 'RAND()'; 
     
    133134 
    134135 
    135 function quotescollection_displayquote($quote_id = 0) 
     136function quotescollection_displayquote($matches) 
    136137{ 
    137     if($quote_id == 0) 
     138    if(!isset($matches[1]) || (isset($matches[1]) && !$matches[1]) || $matches[0] == "[quote|random]") 
    138139        $atts = array( 'orderby' => 'random', 'limit' => 1 ); 
    139140    else 
    140         $atts = array ( 'id' => $quote_id ); 
     141        $atts = array ( 'id' => $matches[1] ); 
    141142     
    142143    return quotescollection_shortcodes($atts); 
     
    144145 
    145146 
    146 function quotescollection_displayquotes_author($author = "") 
     147function quotescollection_displayquotes_author($matches) 
    147148{ 
    148     return quotescollection_shortcodes(array('author'=>$author)); 
     149    return quotescollection_shortcodes(array('author'=>$matches[1])); 
    149150} 
    150151 
    151152 
    152 function quotescollection_displayquotes_source($source = "") 
     153function quotescollection_displayquotes_source($matches) 
    153154{ 
    154     return quotescollection_shortcodes(array('source'=>$source)); 
     155    return quotescollection_shortcodes(array('source'=>$matches[1])); 
    155156} 
    156157 
    157 function quotescollection_displayquotes_tags($tags = "") 
     158function quotescollection_displayquotes_tags($matches) 
    158159{ 
    159     return quotescollection_shortcodes(array('tags'=>$tags)); 
     160    return quotescollection_shortcodes(array('tags'=>$matches[1])); 
    160161} 
    161162 
     
    164165  $start = strpos($text,"[quote|id="); 
    165166  if ($start !== FALSE) { 
    166     $text = preg_replace( "/\[quote\|id=(\d+)\]/ie", "quotescollection_displayquote('\\1')", $text ); 
     167    $text = preg_replace_callback( "/\[quote\|id=(\d+)\]/i", "quotescollection_displayquote", $text ); 
    167168  } 
    168169  $start = strpos($text,"[quote|random]"); 
    169170  if ($start !== FALSE) { 
    170     $text = preg_replace( "/\[quote\|random\]/ie", "quotescollection_displayquote()", $text ); 
     171    $text = preg_replace_callback( "/\[quote\|random\]/i", "quotescollection_displayquote", $text ); 
    171172  } 
    172173  $start = strpos($text,"[quote|all]"); 
    173174  if ($start !== FALSE) { 
    174     $text = preg_replace( "/\[quote\|all\]/ie", "quotescollection_shortcodes()", $text ); 
     175    $text = preg_replace_callback( "/\[quote\|all\]/i", "quotescollection_shortcodes", $text ); 
    175176  } 
    176177    $start = strpos($text,"[quote|author="); 
    177178    if($start !== FALSE) { 
    178         $text = preg_replace("/\[quote\|author=(.{1,})?\]/ie", "quotescollection_displayquotes_author(\"\\1\")", $text); 
     179        $text = preg_replace_callback("/\[quote\|author=(.{1,})?\]/i", "quotescollection_displayquotes_author", $text); 
    179180    } 
    180181    $start = strpos($text,"[quote|source="); 
    181182    if($start !== FALSE) { 
    182         $text = preg_replace("/\[quote\|source=(.{1,})?\]/ie", "quotescollection_displayquotes_source(\"\\1\")", $text); 
     183        $text = preg_replace_callback("/\[quote\|source=(.{1,})?\]/i", "quotescollection_displayquotes_source", $text); 
    183184    } 
    184185    $start = strpos($text,"[quote|tags="); 
    185186    if($start !== FALSE) { 
    186         $text = preg_replace("/\[quote\|tags=(.{1,})?\]/ie", "quotescollection_displayquotes_tags(\"\\1\")", $text); 
     187        $text = preg_replace_callback("/\[quote\|tags=(.{1,})?\]/i", "quotescollection_displayquotes_tags", $text); 
    187188    }   return $text; 
    188189} 
  • quotes-collection/trunk/quotes-collection.php

    r431202 r524245  
    44Plugin URI: http://srinig.com/wordpress/plugins/quotes-collection/ 
    55Description: Quotes Collection plugin with Ajax powered Random Quote sidebar widget helps you collect and display your favourite quotes on your WordPress blog. 
    6 Version: 1.5.4 
     6Version: 1.5.5 
    77Author: Srini G 
    88Author URI: http://srinig.com/wordpress/ 
     
    118118        $url .= "://"; 
    119119        if ($_SERVER["SERVER_PORT"] != "80") { 
    120             $url .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["PHP_SELF"]; 
     120            $url .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"]; 
    121121        } else { 
    122             $url .= $_SERVER["SERVER_NAME"].$_SERVER["PHP_SELF"]; 
    123         } 
     122            $url .= $_SERVER["SERVER_NAME"]; 
     123        } 
     124 
     125        if ( get_option('permalink_structure') != '' ) { 
     126            if($_SERVER['REQUEST_URI']) { 
     127                $request_uri = explode('?', $_SERVER['REQUEST_URI']); 
     128                $url .= $request_uri[0]; 
     129            } 
     130            else $url .= "/"; 
     131        } 
     132        else { 
     133            $url .= $_SERVER["PHP_SELF"]; 
     134        } 
     135         
    124136        if($query_string = $_SERVER['QUERY_STRING']) { 
    125137            $parms = explode('&', $query_string); 
    126             $y = '?'; 
     138            $y = ''; 
    127139            foreach($parms as $parm) { 
    128140                $x = explode('=', $parm); 
  • quotes-collection/trunk/readme.txt

    r431202 r524245  
    44Tags: quotes collection, quotes, quotations, random quote, sidebar, widget, ajax, shortcode 
    55Requires at least: 2.8 
    6 Tested up to: 3.2.1 
     6Tested up to: 3.3.1 
    77Stable tag: trunk 
    88 
     
    108108        * 'author' 
    109109        * 'source' 
    110         * 'date_added' 
     110        * 'time_added' 
    111111        * 'random' 
    112112     
     
    191191 
    192192* `ar` / Arabic / [Ahmed Alharfi](http://www.alharfi.com/) 
     193* `be_BY` / Belarusian / [Alexander Ovsov](http://webhostinggeeks.com/) 
    193194* `bg_BG` / Bulgarian / [Martin Petrov](http://mpetrov.net/) 
    194195* `bs_BA` / Bosnian / Vukasin Stojkov 
    195 * `by_BY` / Belarusian / [Илья](http://www.fatcow.com/) 
    196196* `cs_CZ` / Czech / Josef Ondruch 
    197197* `da_DK` / Danish / [Rune Clausen](http://www.runemester.dk/) 
    198198* `de_DE` / German / [Tobias Koch](http://tobias.kochs-online.net/2008/05/multilingual-blogging-using-wordpress/) 
     199* `el` / Greek / [Spiros Doikas](http://www.translatum.gr/) 
    199200* `es_ES` / Spanish / [Germán L. Martínez (Gershu)](http://www.gershu.com.ar/) 
     201* `et_EE` / Estonian / [Iflexion](http://iflexion.com/) 
    200202* `fa_IR` / Persian / [Ehsan SH](http://mastaneh.ir/) 
    201203* `fi_FI` / Finnish / [Jussi Ruokomäki](http://jussi.ruokomaki.fi/) 
     
    215217* `pt_BR` / Brazilian Portugese / Tzor More 
    216218* `pt_PT` / Portugese / [Djamilo Jacinto](http://www.maxibim.net/) 
     219* `ro_RO` / Romanian / Alexander Ovsov 
    217220* `ru_RU` / Russian / Andrew Malarchuk 
    218221* `sk_SK` / Slovak / [Stefan Stieranka](http://www.itec.sk/) 
     
    227230 
    228231==Changelog== 
     232* **2012-03-27: Version 1.5.5** 
     233    * Security fixes 
     234    * Shortcode output pagination issue fixed 
     235    * Shortcode: 'time_added' value for 'orderby' parameter fixed. 
     236    * Localization in Estonian, Greek, Belarusian and Romanian languages added. 
     237     
    229238* **2011-08-31: Version 1.5.4** 
    230239    * 30 and 60 seconds added to widget auto refresh time option. 
Note: See TracChangeset for help on using the changeset viewer.