Plugin Directory

Changeset 590779


Ignore:
Timestamp:
08/27/2012 06:23:37 AM (14 years ago)
Author:
mg12
Message:
 
Location:
wp-recentcomments/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • wp-recentcomments/trunk/CHANGELOG.txt

    r588696 r590779  
    11    VERSION DATE       TYPE   CHANGES
     2    2.2.3   2012/08/27 FIX    Fixed comments when reviewer name contain '\' character.
    23    2.2.2   2012/08/22 MODIFY Edit JavaScript with JSHint rules.
    34                       MODIFY Add notice when submit successfully.
  • wp-recentcomments/trunk/README.txt

    r588696 r590779  
    55Requires at least: 2.5
    66Tested up to: 3.4.1
    7 Stable tag: 2.2.2
     7Stable tag: 2.2.3
    88
    99Display recent comments in your blog sidebar.
     
    100100
    101101    VERSION DATE       TYPE   CHANGES
     102    2.2.3   2012/08/27 FIX    Fixed comments when reviewer name contain '\' character.
    102103    2.2.2   2012/08/22 MODIFY Edit JavaScript with JSHint rules.
    103104                       MODIFY Add notice when submit successfully.
  • wp-recentcomments/trunk/core.php

    r544370 r590779  
    157157        // Formatting title.
    158158        $postTitle = rc_format_title(get_the_title($comment->comment_post_ID));
     159
     160        // Formatting reviewer name.
     161        $reviewerName = rc_format_reviewer_name($comment->comment_author);
    159162
    160163        // Formatting content.
     
    199202        $json .= '"timestamp":"'        . $timestamp                                                        . '",';
    200203        $json .= '"postUrl":"'          . get_permalink($comment->comment_post_ID)                          . '",';
    201         $json .= '"reviewerName":"'     . $comment->comment_author                                          . '",';
     204        $json .= '"reviewerName":"'     . $reviewerName                                                     . '",';
    202205        $json .= '"reviewerUrl":"'      . get_comment_author_url()                                          . '",';
    203206        $json .= '"id":"'               . $comment->comment_ID                                              . '",';
     
    233236function rc_format_title($title) {
    234237    // Encode " and '.
    235     return preg_replace(array('/\<(.+?)\>/', '/\"/', "/\'/"), array('', '\"', "\'"), $title);
     238    return preg_replace(array('/\<(.+?)\>/', '/\\\/', '/\"/', "/\'/"), array('', '\\\\\\', '\"', "\'"), $title);
     239}
     240
     241/**
     242 * Retrieve formatted reviewer name.
     243 */
     244function rc_format_reviewer_name($content) {
     245
     246    // Encode \, " and '.
     247    return preg_replace(array('/\\\/', '/\"/', "/\'/"), array('\\\\\\', '\"', "\'"), $content);
    236248}
    237249
     
    246258    }
    247259
    248     // Encode " and '.
    249     return preg_replace(array('/\"/', "/\'/"), array('\"', "\'"), $content);
     260    // Encode \, " and '.
     261    return preg_replace(array('/\\\/', '/\"/', "/\'/"), array('\\\\\\', '\"', "\'"), $content);
    250262}
    251263
  • wp-recentcomments/trunk/wp-recentcomments.php

    r590768 r590779  
    44Plugin URI: http://www.neoease.com/plugins/
    55Description: Show the recent comments in your WordPress sidebar.
    6 Version: 2.2.2
     6Version: 2.2.3
    77Author: mg12
    88Author URI: http://www.neoease.com/
     
    482482function load_static() {
    483483    $options = get_option('wp_recentcomments_options');
    484     $plugins_version = '2.2.2';
     484    $plugins_version = '2.2.3';
    485485    $plugins_url = plugins_url('wp-recentcomments');
    486486    $plugins_css_url = $plugins_url . '/css';
Note: See TracChangeset for help on using the changeset viewer.