Plugin Directory

Changeset 1232303


Ignore:
Timestamp:
08/27/2015 04:12:18 PM (11 years ago)
Author:
Webblerock
Message:

use \b in regex so we exclude matches within words

File:
1 edited

Legend:

Unmodified
Added
Removed
  • simple-wp-glossary/trunk/simple-wp-glossary.php

    r1232302 r1232303  
    1818            $term = $i->post_title;
    1919            $definition = $i->post_excerpt;
    20             $regex[] = "/({$term})(?!([^<]+)?>)/i";
     20            $regex[] = "/(\b{$term}\b)(?!([^<]+)?>)/i";
    2121            $replacements[] = "<dfn title=\"{$definition}\">$1</dfn>";
    2222        }
Note: See TracChangeset for help on using the changeset viewer.