WordPress.org

Plugin Directory

Changeset 1175627


Ignore:
Timestamp:
06/06/15 00:38:01 (3 years ago)
Author:
chorton2227
Message:

Update to version 1.2.3

Location:
wp-glossary-hover
Files:
471 added
6 edited

Legend:

Unmodified
Added
Removed
  • wp-glossary-hover/trunk/README.txt

    r1163729 r1175627  
    55Requires at least: 3.5.1 
    66Tested up to: 4.2.2 
    7 Stable tag: 1.2.2 
     7Stable tag: 1.2.3 
    88License: GPLv2 or later 
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html 
     
    5757== Changelog == 
    5858 
     59= 1.2.3 = 
     60* Fix errors in versions of php earlier than php 5.4. 
     61* Remove the '...' when not limiting the characters in the definition. 
     62 
    5963= 1.2.2 = 
    6064* Fix encoding between html and xml entities. 
  • wp-glossary-hover/trunk/languages/en_US.po

    r1163729 r1175627  
    11msgid "" 
    22msgstr "" 
    3 "Project-Id-Version: WP Glossary Hover v1.2.2\n" 
    4 "POT-Creation-Date: 2015-05-19 19:12-0500\n" 
    5 "PO-Revision-Date: 2015-05-19 19:12-0500\n" 
     3"Project-Id-Version: WP Glossary Hover v1.2.3\n" 
     4"POT-Creation-Date: 2015-06-05 20:06-0500\n" 
     5"PO-Revision-Date: 2015-06-05 20:08-0500\n" 
    66"Last-Translator: Chris Horton <chorton2227@gmail.com>\n" 
    77"Language-Team: Chris Horton <chorton2227@gmail.com>\n" 
  • wp-glossary-hover/trunk/public/class-wp-glossary-hover.php

    r1163729 r1175627  
    2525     * @var     string 
    2626     */ 
    27     const VERSION = '1.2.2'; 
     27    const VERSION = '1.2.3'; 
    2828 
    2929    /** 
  • wp-glossary-hover/trunk/public/includes/class-tooltip-parser.php

    r1163729 r1175627  
    235235            if ($updateNode) 
    236236            { 
    237                 $newNode = $dom->createDocumentFragment(); 
    238                 $newNode->appendXML($nodeValue); 
     237                $newNode = $dom->createCDATASection($nodeValue); 
    239238                $node->parentNode->replaceChild($newNode, $node); 
    240239            } 
     
    342341 
    343342    /** 
    344      * Decode html entities before cleaning definition. Strip all tags and 
    345      * limit the number characters in the definition, if required. 
    346      * Trim all non alpha-numeric characters from the end of the definition. 
    347      * Add the read more '...' formatting. Re-encode defintion to XML. 
    348      * 
    349      * @see      http://php.net/html_entity_decode 
    350      * @see      http://php.net/htmlentities 
     343     * Strip all tags and limit the number characters in the definition, if required. 
     344     * Encode double and single quotes. 
     345     * 
     346     * @see      http://php.net/en/htmlentities 
    351347     * @since    1.2.0 
    352348     * @param    string    $definition    Definition of glossary term. 
     
    355351    private function clean_definition($definition) { 
    356352 
    357         // Default flags used by html_entity_decode 
    358         $decoding_flags = ENT_COMPAT | ENT_HTML401; 
    359  
    360         // Encode definition to XML 
    361         $encoding_flags = ENT_COMPAT | ENT_XML1; 
    362  
    363         $definition = html_entity_decode($definition, $decoding_flags, $this->encoding); 
     353        // Remove any html tags 
    364354        $definition = strip_tags($definition); 
     355 
     356        // Limit characters 
    365357        $definition = $this->limit_characters_in_definition($definition); 
    366         $definition = preg_replace($this->trim_regex_pattern, '', $definition); 
    367         $definition = sprintf($this->tooltip_more, $definition); 
    368         $definition = htmlentities($definition, $encoding_flags, $this->encoding); 
     358 
     359        // Encode double and single quotes 
     360        $definition = htmlentities($definition, ENT_QUOTES, $this->encoding); 
     361 
    369362        return $definition; 
    370363 
     
    372365 
    373366    /** 
    374      * Limit characters in definition, based on setting and length of definition.  
     367     * Limit characters in definition, based on setting and length of definition. 
     368     * If definition needs to be limited, trim all non-alphanumeric characters 
     369     * from the end of the definition and append the more formatting. 
    375370     * 
    376371     * @since    1.2.0 
     
    390385            $definition = substr($definition, 0, $limit_characters); 
    391386 
    392             // Find last occurrence of whitespace within limit 
    393             $position = strrpos($definition, ' '); 
    394  
    395             // Cut at last whitespace within limit 
    396             if (FALSE !== $position) { 
    397                 $definition = substr($definition, 0, $position); 
    398             } 
     387            // Trim any non-alphanumeric characters from end of definition 
     388            $definition = preg_replace($this->trim_regex_pattern, '', $definition); 
     389 
     390            // Append the more formatting 
     391            $definition = sprintf($this->tooltip_more, $definition); 
    399392        } 
    400393 
  • wp-glossary-hover/trunk/wp-glossary-hover.php

    r1163729 r1175627  
    1616 * Plugin URI:        https://github.com/chorton2227/WP-Glossary-Hover 
    1717 * Description:       When hovering over a word or phrase show the user created definition. 
    18  * Version:           1.2.2 
     18 * Version:           1.2.3 
    1919 * Author:            Chris Horton <chorton2227@gmail.com> 
    2020 * Author URI:        https://github.com/chorton2227 
Note: See TracChangeset for help on using the changeset viewer.