WordPress.org

Plugin Directory

Changeset 412465


Ignore:
Timestamp:
07/20/11 10:19:11 (3 years ago)
Author:
kirilln
Message:

3.3.13

  • Bug fix: form-based embeds did not work in posts and pages
  • Improvement: filtered bad words are now encoded so they don't appear in page HTML source in plain text
  • Tested with WordPress 3.2.1
Location:
tweet-blender/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • tweet-blender/trunk/js/lib.js

    r383451 r412465  
    143143     return s; 
    144144}; 
     145 
     146// Base64 decode 
     147String.prototype.base64_decode = function() { 
     148  
     149    var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", 
     150        o1, o2, o3, h1, h2, h3, h4, bits, i = 0, 
     151        ac = 0, 
     152        dec = "", 
     153        tmp_arr = [], 
     154        data = this; 
     155 
     156    if (!data) { 
     157        return data; 
     158    } 
     159 
     160    data += ''; 
     161 
     162    do { // unpack four hexets into three octets using index points in b64 
     163        h1 = b64.indexOf(data.charAt(i++)); 
     164        h2 = b64.indexOf(data.charAt(i++)); 
     165        h3 = b64.indexOf(data.charAt(i++)); 
     166        h4 = b64.indexOf(data.charAt(i++)); 
     167 
     168        bits = h1 << 18 | h2 << 12 | h3 << 6 | h4; 
     169 
     170        o1 = bits >> 16 & 0xff; 
     171        o2 = bits >> 8 & 0xff; 
     172        o3 = bits & 0xff; 
     173 
     174        if (h3 == 64) { 
     175            tmp_arr[ac++] = String.fromCharCode(o1); 
     176        } else if (h4 == 64) { 
     177            tmp_arr[ac++] = String.fromCharCode(o1, o2); 
     178        } else { 
     179            tmp_arr[ac++] = String.fromCharCode(o1, o2, o3); 
     180        } 
     181    } while (i < data.length); 
     182 
     183    dec = tmp_arr.join(''); 
     184    dec = dec.utf8_decode(); 
     185 
     186    return dec; 
     187} 
     188 
     189String.prototype.utf8_decode = function() { 
     190     
     191    var tmp_arr = [], 
     192        i = 0, 
     193        ac = 0, 
     194        c1 = 0, 
     195        c2 = 0, 
     196        c3 = 0, 
     197        str_data = this; 
     198 
     199    str_data += ''; 
     200 
     201    while (i < str_data.length) { 
     202        c1 = str_data.charCodeAt(i); 
     203        if (c1 < 128) { 
     204            tmp_arr[ac++] = String.fromCharCode(c1); 
     205            i++; 
     206        } else if (c1 > 191 && c1 < 224) { 
     207            c2 = str_data.charCodeAt(i + 1); 
     208            tmp_arr[ac++] = String.fromCharCode(((c1 & 31) << 6) | (c2 & 63)); 
     209            i += 2; 
     210        } else { 
     211            c2 = str_data.charCodeAt(i + 1); 
     212            c3 = str_data.charCodeAt(i + 2); 
     213            tmp_arr[ac++] = String.fromCharCode(((c1 & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); 
     214            i += 3; 
     215        } 
     216    } 
     217 
     218    return tmp_arr.join(''); 
     219} 
  • tweet-blender/trunk/js/main.js

    r406596 r412465  
    33 */ 
    44 
    5 var TB_version = '3.3.12',  // Plugin version  
     5var TB_version = '3.3.13',  // Plugin version  
    66TB_rateLimitData, 
    77TB_tmp, 
     
    4242         
    4343        // if there is widget HTML div following the form we don't need to build HTML 
    44         if (jQuery('#'+obj.id).next().length > 0) {  
    45             if (jQuery('#' + obj.id).next().attr('id') != '') { 
    46                 if (jQuery('#' + obj.id).next().attr('id').indexOf('-mc') > 0) { 
     44        if (typeof(obj.next) != 'undefined') {  
     45            if (typeof(obj.next().attr('id')) != 'undefined' && obj.next().attr('id') != '') { 
     46                if (obj.next().attr('id').indexOf('-mc') > 0) { 
    4747                    widgetId = widgetConfId.substr(0, widgetConfId.length - 2); 
    4848                } 
     
    12271227        // if there are filtered words and the tweet text matches any of them - skip this tweet 
    12281228        if (typeof(TB_config['filter_bad_strings']) != 'undefined' && TB_config.filter_bad_strings.length > 0) { 
    1229             badStrings = TB_config.filter_bad_strings.split(','); 
     1229            badStrings = TB_config.filter_bad_strings.base64_decode().split(','); 
    12301230            for (i = 0; i < badStrings.length; i++) { 
    12311231                if (this.jsonCode.text.indexOf(badStrings[i]) >= 0 || this.screenName.indexOf(badStrings[i]) >= 0) { 
  • tweet-blender/trunk/readme.txt

    r406596 r412465  
    33Tags: sidebar, twitter, tweets, multiple authors, favorites, tweet, tags, lists, hashtags, archive, widget, admin, AJAX, jquery, keywords, BuddyPress, blender 
    44Requires at least: 2.8.0 
    5 Tested up to: 3.2 
    6 Stable tag: 3.3.12 
     5Tested up to: 3.2.1 
     6Stable tag: 3.3.13 
    77Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5907095 
    88 
     
    185185== Changelog == 
    186186 
     187= 3.3.13 = 
     188* Bug fix: form-based embeds did not work in posts and pages 
     189* Improvement: filtered bad words are now encoded so they don't appear in page HTML source in plain text 
     190* Tested with WordPress 3.2.1 
     191 
    187192= 3.3.12 = 
    188193* Bug fix: error during activation "Fatal error: Cannot redeclare class Services_JSON in /.../wp-content/plugins/tweet-blender/lib/JSON.php on line 116" (thanks to Peter O for reporting via WP Support forum) 
  • tweet-blender/trunk/tweet-blender.php

    r406596 r412465  
    44Plugin URI: http://www.tweetblender.com 
    55Description: Provides several Twitter widgets: show your own tweets, show tweets relevant to post's tags, show tweets for Twitter lists, show tweets for hashtags, show tweets for keyword searches, show favorite tweets. Multiple widgets on the same page are supported. Can combine sources and blend all of them into a single stream. 
    6 Version: 3.3.12 
     6Version: 3.3.13 
    77Author: Kirill Novitchenko 
    88Author URI: http://kirill-novitchenko.com 
     
    149149        unset($tb_o['advanced_reroute_type']); 
    150150        unset($tb_o['db_version']); 
     151         
     152        // urlencode bad words 
     153        if (isset($tb_o['filter_bad_strings'])) { 
     154            $tb_o['filter_bad_strings'] = base64_encode($tb_o['filter_bad_strings']); 
     155        } 
    151156                 
    152157        foreach($tb_o as $opt => $val) { 
Note: See TracChangeset for help on using the changeset viewer.