@@ -136,8 +136,10 @@ function wptexturize( $text, $reset = false ) {
136136 $ static_characters = array_merge ( array ( '... ' , '`` ' , '\'\'' , ' (tm) ' ), $ cockney );
137137 $ static_replacements = array_merge ( array ( '… ' , $ opening_quote , $ closing_quote , ' ™ ' ), $ cockneyreplace );
138138
139- // Pattern-based replacements of characters.
140- // Sort the remaining patterns into several arrays for performance tuning.
139+ /*
140+ * Pattern-based replacements of characters.
141+ * Sort the remaining patterns into several arrays for performance tuning.
142+ */
141143 $ dynamic_characters = array (
142144 'apos ' => array (),
143145 'quote ' => array (),
@@ -340,8 +342,10 @@ function wptexturize_primes( $haystack, $needle, $prime, $open_quote, $close_quo
340342 // Assume the rightmost quote-period match is the end of quotation.
341343 $ pos = strrpos ( $ sentence , "$ flag. " );
342344 } else {
343- // When all else fails, make the rightmost candidate a closing quote.
344- // This is most likely to be problematic in the context of bug #18549.
345+ /*
346+ * When all else fails, make the rightmost candidate a closing quote.
347+ * This is most likely to be problematic in the context of bug #18549.
348+ */
345349 $ pos = strrpos ( $ sentence , $ flag );
346350 }
347351 $ sentence = substr_replace ( $ sentence , $ close_quote , $ pos , strlen ( $ flag ) );
@@ -976,8 +980,10 @@ function _wp_specialchars( $text, $quote_style = ENT_NOQUOTES, $charset = false,
976980 }
977981
978982 if ( ! $ double_encode ) {
979- // Guarantee every &entity; is valid, convert &garbage; into &garbage;
980- // This is required for PHP < 5.4.0 because ENT_HTML401 flag is unavailable.
983+ /*
984+ * Guarantee every &entity; is valid, convert &garbage; into &garbage;
985+ * This is required for PHP < 5.4.0 because ENT_HTML401 flag is unavailable.
986+ */
981987 $ text = wp_kses_normalize_entities ( $ text , ( $ quote_style & ENT_XML1 ) ? 'xml ' : 'html ' );
982988 }
983989
@@ -1601,8 +1607,10 @@ function remove_accents( $text, $locale = '' ) {
16011607
16021608 if ( seems_utf8 ( $ text ) ) {
16031609
1604- // Unicode sequence normalization from NFD (Normalization Form Decomposed)
1605- // to NFC (Normalization Form [Pre]Composed), the encoding used in this function.
1610+ /*
1611+ * Unicode sequence normalization from NFD (Normalization Form Decomposed)
1612+ * to NFC (Normalization Form [Pre]Composed), the encoding used in this function.
1613+ */
16061614 if ( function_exists ( 'normalizer_is_normalized ' )
16071615 && function_exists ( 'normalizer_normalize ' )
16081616 ) {
@@ -1817,8 +1825,7 @@ function remove_accents( $text, $locale = '' ) {
18171825 '€ ' => 'E ' ,
18181826 // GBP (Pound) sign.
18191827 '£ ' => '' ,
1820- // Vowels with diacritic (Vietnamese).
1821- // Unmarked.
1828+ // Vowels with diacritic (Vietnamese). Unmarked.
18221829 'Ơ ' => 'O ' ,
18231830 'ơ ' => 'o ' ,
18241831 'Ư ' => 'U ' ,
@@ -2661,17 +2668,24 @@ function force_balance_tags( $text ) {
26612668 $ tag = '' ;
26622669 }
26632670 } else { // Begin tag.
2664- if ( $ has_self_closer ) { // If it presents itself as a self-closing tag...
2665- // ...but it isn't a known single-entity self-closing tag, then don't let it be treated as such
2666- // and immediately close it with a closing tag (the tag will encapsulate no text as a result).
2671+ if ( $ has_self_closer ) {
2672+ /*
2673+ * If it presents itself as a self-closing tag, but it isn't a known single-entity self-closing tag,
2674+ * then don't let it be treated as such and immediately close it with a closing tag.
2675+ * The tag will encapsulate no text as a result.
2676+ */
26672677 if ( ! $ is_single_tag ) {
26682678 $ attributes = trim ( substr ( $ attributes , 0 , -1 ) ) . "></ $ tag " ;
26692679 }
2670- } elseif ( $ is_single_tag ) { // Else if it's a known single-entity tag but it doesn't close itself, do so.
2680+ } elseif ( $ is_single_tag ) {
2681+ // Else if it's a known single-entity tag but it doesn't close itself, do so.
26712682 $ pre_attribute_ws = ' ' ;
26722683 $ attributes .= '/ ' ;
2673- } else { // It's not a single-entity tag.
2674- // If the top of the stack is the same as the tag we want to push, close previous tag.
2684+ } else {
2685+ /*
2686+ * It's not a single-entity tag.
2687+ * If the top of the stack is the same as the tag we want to push, close previous tag.
2688+ */
26752689 if ( $ stacksize > 0 && ! in_array ( $ tag , $ nestable_tags , true ) && $ tagstack [ $ stacksize - 1 ] === $ tag ) {
26762690 $ tagqueue = '</ ' . array_pop ( $ tagstack ) . '> ' ;
26772691 $ stacksize --;
@@ -2925,8 +2939,10 @@ function _make_url_clickable_cb( $matches ) {
29252939 $ url = $ matches [2 ];
29262940
29272941 if ( ') ' === $ matches [3 ] && strpos ( $ url , '( ' ) ) {
2928- // If the trailing character is a closing parethesis, and the URL has an opening parenthesis in it,
2929- // add the closing parenthesis to the URL. Then we can let the parenthesis balancer do its thing below.
2942+ /*
2943+ * If the trailing character is a closing parethesis, and the URL has an opening parenthesis in it,
2944+ * add the closing parenthesis to the URL. Then we can let the parenthesis balancer do its thing below.
2945+ */
29302946 $ url .= $ matches [3 ];
29312947 $ suffix = '' ;
29322948 } else {
@@ -3106,8 +3122,10 @@ function make_clickable( $text ) {
31063122 )
31073123 (\)?) # 3: Trailing closing parenthesis (for parethesis balancing post processing).
31083124 ~xS ' ;
3109- // The regex is a non-anchored pattern and does not have a single fixed starting character.
3110- // Tell PCRE to spend more time optimizing since, when used on a page load, it will probably be used several times.
3125+ /*
3126+ * The regex is a non-anchored pattern and does not have a single fixed starting character.
3127+ * Tell PCRE to spend more time optimizing since, when used on a page load, it will probably be used several times.
3128+ */
31113129
31123130 $ ret = preg_replace_callback ( $ url_clickable , '_make_url_clickable_cb ' , $ ret );
31133131
@@ -3556,15 +3574,19 @@ function is_email( $email, $deprecated = false ) {
35563574 // Split out the local and domain parts.
35573575 list ( $ local , $ domain ) = explode ( '@ ' , $ email , 2 );
35583576
3559- // LOCAL PART
3560- // Test for invalid characters.
3577+ /*
3578+ * LOCAL PART
3579+ * Test for invalid characters.
3580+ */
35613581 if ( ! preg_match ( '/^[a-zA-Z0-9!#$%& \'*+\/=?^_`{|}~\.-]+$/ ' , $ local ) ) {
35623582 /** This filter is documented in wp-includes/formatting.php */
35633583 return apply_filters ( 'is_email ' , false , $ email , 'local_invalid_chars ' );
35643584 }
35653585
3566- // DOMAIN PART
3567- // Test for sequences of periods.
3586+ /*
3587+ * DOMAIN PART
3588+ * Test for sequences of periods.
3589+ */
35683590 if ( preg_match ( '/\.{2,}/ ' , $ domain ) ) {
35693591 /** This filter is documented in wp-includes/formatting.php */
35703592 return apply_filters ( 'is_email ' , false , $ email , 'domain_period_sequence ' );
@@ -3766,16 +3788,20 @@ function sanitize_email( $email ) {
37663788 // Split out the local and domain parts.
37673789 list ( $ local , $ domain ) = explode ( '@ ' , $ email , 2 );
37683790
3769- // LOCAL PART
3770- // Test for invalid characters.
3791+ /*
3792+ * LOCAL PART
3793+ * Test for invalid characters.
3794+ */
37713795 $ local = preg_replace ( '/[^a-zA-Z0-9!#$%& \'*+\/=?^_`{|}~\.-]/ ' , '' , $ local );
37723796 if ( '' === $ local ) {
37733797 /** This filter is documented in wp-includes/formatting.php */
37743798 return apply_filters ( 'sanitize_email ' , '' , $ email , 'local_invalid_chars ' );
37753799 }
37763800
3777- // DOMAIN PART
3778- // Test for sequences of periods.
3801+ /*
3802+ * DOMAIN PART
3803+ * Test for sequences of periods.
3804+ */
37793805 $ domain = preg_replace ( '/\.{2,}/ ' , '' , $ domain );
37803806 if ( '' === $ domain ) {
37813807 /** This filter is documented in wp-includes/formatting.php */
0 commit comments