Plugin Directory

Changeset 146309


Ignore:
Timestamp:
08/16/2009 08:56:57 AM (17 years ago)
Author:
ketsugi
Message:

[FIX] Fixed a bug that replaced acronyms inside BBCode, breaking the output HTML

Location:
acronyms/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • acronyms/trunk/acronyms.php

    r92954 r146309  
    44Plugin URI: http://ketsugi.com/software/wordpress/acronyms-plugin/
    55Description: A plugin to wrap acronyms in posts and comments with appropriate <acronym> acronyms. Allows users to manage lists of acronyms through admin interface. Based on Joel Bennett's Acronym Replacer plugin (http://www.huddledmasses.org/) and Joel Pan's NP_Acronym plugin for Nucleus CMS.
    6 Version: 1.6.1
     6Version: 1.6.2
    77Author: Joel Pan
    88Author URI: http://ketsugi.com/
     
    3333    function install ()
    3434    {
     35                 echo "BOOYAH";
    3536        // Populate defaults
    3637        $acronyms = array(
     
    170171        );
    171172        add_option( 'acronym_acronyms', $acronyms );
    172 
    173         // Add default options -- Options not currently modifiable by user
    174         add_option( 'acronym_content', 1 );
    175         add_option( 'acronym_comments', 1 );
    176173    }
    177174
     
    190187    {
    191188        // Perhaps I should remove the acronyms when uninstalling to clear out the cruft? But what if the user is just temporarily deactivating the plugin with the intention to activate it again later, and doesn't want to lose all his/her custom acronyms?
     189                echo "BOOYAH";
    192190    }
    193191
     
    375373        $text = " $text ";
    376374        foreach ( $acronyms as $acronym => $fulltext )
    377             $text = preg_replace( "|(?!<[^<>]*?)(?<![?.&])\b$acronym\b(?!:)(?![^<>]*?>)|msU", "<acronym title=\"$fulltext\">$acronym</acronym>" , $text );
     375            $text = preg_replace( "|(?!<[^<>]*?)(?!\[[^\[\]]*?)(?<![?.&])\b$acronym\b(?!:)(?![^\[\]]*?\])(?![^<>]*?>)|msU", "<acronym title=\"$fulltext\">$acronym</acronym>" , $text );
    378376        $text = trim($text);
    379         return $text;
     377        //return $text;
     378        return "BOOYAH";
    380379    }
    381380
     
    611610register_activation_hook( __FILE__, array( 'Acronyms', 'install' ) );
    612611//register_deactivation_hook( __FILE__, array( 'Acronyms', 'uninstall' ) );
    613 if (1 == get_option( 'acronym_content' ) )
    614     add_filter( 'the_content', array( 'Acronyms', 'acronym_replace' ) );
    615 if (1 == get_option( 'acronym_comments' ) )
    616     add_filter( 'comment_text', array( 'Acronyms', 'acronym_replace' ) );
     612add_filter( 'the_content', array( 'Acronyms', 'acronym_replace' ) );
     613add_filter( 'comment_text', array( 'Acronyms', 'acronym_replace' ) );
    617614add_action( 'admin_menu', array( 'Acronyms', 'add_pages' ) );
    618615?>
  • acronyms/trunk/readme.txt

    r92951 r146309  
    11=== Acronyms ===
    22Contributors: ketsugi
    3 Donate link: http://ketsugi.com/paypal_donate.php?plugin=WordPress%20-%20Acronyms%20Plugin
    43Tags: acronym, post, formatting
    54Requires at least: 2.7
    6 Tested up to: 2.7
    7 Stable tag: 1.6.1
     5Tested up to: 2.8.4
     6Stable tag: 1.6.2
    87
    98A plugin to wrap acronyms in posts and comments with appropriate `<acronym>` acronyms. Allows users to manage lists of acronyms through admin interface. Based on Joel Bennett's Acronym Replacer plugin (http://www.huddledmasses.org/) and Joel Pan's NP_Acronym plugin for Nucleus CMS.
     
    3332== Change Log ==
    3433
     34* 1.6.2 - 16 Aug 2009
     35   * [FIX] Fixed a bug that replaced acronyms inside BBCode, breaking the output HTML
    3536* 1.6.1 - 9 Feb 2009
    3637   * [FIX] Fixed the same bug... again...
Note: See TracChangeset for help on using the changeset viewer.