Make WordPress Core

Changeset 7190


Ignore:
Timestamp:
03/09/2008 10:11:20 PM (18 years ago)
Author:
westi
Message:

Remove the entity decoding and recoding from wp_html_excerpt. Fixes #6077 props nbachiyski.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/formatting.php

    r7140 r7190  
    13741374 * Safely extracts not more than the first $count characters from html string
    13751375 *
    1376  * UTF-8, tags and entities safe prefix extraction. Entities inside will be
    1377  * counted as one character. As a side effect, all entities will be converted to
    1378  * their decimal form.
     1376 * UTF-8, tags and entities safe prefix extraction. Entities inside will *NOT* be
     1377 * counted as one character. For example & will be counted as 4, < as 3, etc.
    13791378 *
    13801379 * @param integer $str String to get the excerpt from
    1381  * @param integer $count Maximum number of visible characters to take
     1380 * @param integer $count Maximum number of characters to take
    13821381 * @eaturn string the excerpt
    13831382 */
    13841383function wp_html_excerpt( $str, $count ) {
    13851384    $str = strip_tags( $str );
    1386     $str = html_entity_decode( $str, ENT_QUOTES);
    13871385    $str = mb_strcut( $str, 0, $count );
    13881386    // remove part of an entity at the end
    13891387    $str = preg_replace( '/&[^;\s]{0,6}$/', '', $str );
    1390     // we decoded some entities we should put back
    1391     $str = wp_specialchars( $str );
    13921388    return $str;
    13931389}
Note: See TracChangeset for help on using the changeset viewer.