Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/wp-inclu...
File: formatting.php
'ˆ' => 'ˆ',
[2500] Fix | Delete
'‰' => '‰',
[2501] Fix | Delete
'Š' => 'Š',
[2502] Fix | Delete
'‹' => '‹',
[2503] Fix | Delete
'Œ' => 'Œ',
[2504] Fix | Delete
'' => '',
[2505] Fix | Delete
'Ž' => 'Ž',
[2506] Fix | Delete
'' => '',
[2507] Fix | Delete
'' => '',
[2508] Fix | Delete
'‘' => '‘',
[2509] Fix | Delete
'’' => '’',
[2510] Fix | Delete
'“' => '“',
[2511] Fix | Delete
'”' => '”',
[2512] Fix | Delete
'•' => '•',
[2513] Fix | Delete
'–' => '–',
[2514] Fix | Delete
'—' => '—',
[2515] Fix | Delete
'˜' => '˜',
[2516] Fix | Delete
'™' => '™',
[2517] Fix | Delete
'š' => 'š',
[2518] Fix | Delete
'›' => '›',
[2519] Fix | Delete
'œ' => 'œ',
[2520] Fix | Delete
'' => '',
[2521] Fix | Delete
'ž' => 'ž',
[2522] Fix | Delete
'Ÿ' => 'Ÿ',
[2523] Fix | Delete
);
[2524] Fix | Delete
[2525] Fix | Delete
if ( str_contains( $content, '&#1' ) ) {
[2526] Fix | Delete
$content = strtr( $content, $wp_htmltranswinuni );
[2527] Fix | Delete
}
[2528] Fix | Delete
[2529] Fix | Delete
return $content;
[2530] Fix | Delete
}
[2531] Fix | Delete
[2532] Fix | Delete
/**
[2533] Fix | Delete
* Balances tags if forced to, or if the 'use_balanceTags' option is set to true.
[2534] Fix | Delete
*
[2535] Fix | Delete
* @since 0.71
[2536] Fix | Delete
*
[2537] Fix | Delete
* @param string $text Text to be balanced
[2538] Fix | Delete
* @param bool $force If true, forces balancing, ignoring the value of the option. Default false.
[2539] Fix | Delete
* @return string Balanced text
[2540] Fix | Delete
*/
[2541] Fix | Delete
function balanceTags( $text, $force = false ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
[2542] Fix | Delete
if ( $force || (int) get_option( 'use_balanceTags' ) === 1 ) {
[2543] Fix | Delete
return force_balance_tags( $text );
[2544] Fix | Delete
} else {
[2545] Fix | Delete
return $text;
[2546] Fix | Delete
}
[2547] Fix | Delete
}
[2548] Fix | Delete
[2549] Fix | Delete
/**
[2550] Fix | Delete
* Balances tags of string using a modified stack.
[2551] Fix | Delete
*
[2552] Fix | Delete
* @since 2.0.4
[2553] Fix | Delete
* @since 5.3.0 Improve accuracy and add support for custom element tags.
[2554] Fix | Delete
*
[2555] Fix | Delete
* @author Leonard Lin <leonard@acm.org>
[2556] Fix | Delete
* @license GPL
[2557] Fix | Delete
* @copyright November 4, 2001
[2558] Fix | Delete
* @version 1.1
[2559] Fix | Delete
* @todo Make better - change loop condition to $text in 1.2
[2560] Fix | Delete
* @internal Modified by Scott Reilly (coffee2code) 02 Aug 2004
[2561] Fix | Delete
* 1.1 Fixed handling of append/stack pop order of end text
[2562] Fix | Delete
* Added Cleaning Hooks
[2563] Fix | Delete
* 1.0 First Version
[2564] Fix | Delete
*
[2565] Fix | Delete
* @param string $text Text to be balanced.
[2566] Fix | Delete
* @return string Balanced text.
[2567] Fix | Delete
*/
[2568] Fix | Delete
function force_balance_tags( $text ) {
[2569] Fix | Delete
$tagstack = array();
[2570] Fix | Delete
$stacksize = 0;
[2571] Fix | Delete
$tagqueue = '';
[2572] Fix | Delete
$newtext = '';
[2573] Fix | Delete
// Known single-entity/self-closing tags.
[2574] Fix | Delete
$single_tags = array( 'area', 'base', 'basefont', 'br', 'col', 'command', 'embed', 'frame', 'hr', 'img', 'input', 'isindex', 'link', 'meta', 'param', 'source', 'track', 'wbr' );
[2575] Fix | Delete
// Tags that can be immediately nested within themselves.
[2576] Fix | Delete
$nestable_tags = array( 'article', 'aside', 'blockquote', 'details', 'div', 'figure', 'object', 'q', 'section', 'span' );
[2577] Fix | Delete
[2578] Fix | Delete
// WP bug fix for comments - in case you REALLY meant to type '< !--'.
[2579] Fix | Delete
$text = str_replace( '< !--', '< !--', $text );
[2580] Fix | Delete
// WP bug fix for LOVE <3 (and other situations with '<' before a number).
[2581] Fix | Delete
$text = preg_replace( '#<([0-9]{1})#', '&lt;$1', $text );
[2582] Fix | Delete
[2583] Fix | Delete
/**
[2584] Fix | Delete
* Matches supported tags.
[2585] Fix | Delete
*
[2586] Fix | Delete
* To get the pattern as a string without the comments paste into a PHP
[2587] Fix | Delete
* REPL like `php -a`.
[2588] Fix | Delete
*
[2589] Fix | Delete
* @see https://html.spec.whatwg.org/#elements-2
[2590] Fix | Delete
* @see https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name
[2591] Fix | Delete
*
[2592] Fix | Delete
* @example
[2593] Fix | Delete
* ~# php -a
[2594] Fix | Delete
* php > $s = [paste copied contents of expression below including parentheses];
[2595] Fix | Delete
* php > echo $s;
[2596] Fix | Delete
*/
[2597] Fix | Delete
$tag_pattern = (
[2598] Fix | Delete
'#<' . // Start with an opening bracket.
[2599] Fix | Delete
'(/?)' . // Group 1 - If it's a closing tag it'll have a leading slash.
[2600] Fix | Delete
'(' . // Group 2 - Tag name.
[2601] Fix | Delete
// Custom element tags have more lenient rules than HTML tag names.
[2602] Fix | Delete
'(?:[a-z](?:[a-z0-9._]*)-(?:[a-z0-9._-]+)+)' .
[2603] Fix | Delete
'|' .
[2604] Fix | Delete
// Traditional tag rules approximate HTML tag names.
[2605] Fix | Delete
'(?:[\w:]+)' .
[2606] Fix | Delete
')' .
[2607] Fix | Delete
'(?:' .
[2608] Fix | Delete
// We either immediately close the tag with its '>' and have nothing here.
[2609] Fix | Delete
'\s*' .
[2610] Fix | Delete
'(/?)' . // Group 3 - "attributes" for empty tag.
[2611] Fix | Delete
'|' .
[2612] Fix | Delete
// Or we must start with space characters to separate the tag name from the attributes (or whitespace).
[2613] Fix | Delete
'(\s+)' . // Group 4 - Pre-attribute whitespace.
[2614] Fix | Delete
'([^>]*)' . // Group 5 - Attributes.
[2615] Fix | Delete
')' .
[2616] Fix | Delete
'>#' // End with a closing bracket.
[2617] Fix | Delete
);
[2618] Fix | Delete
[2619] Fix | Delete
while ( preg_match( $tag_pattern, $text, $regex ) ) {
[2620] Fix | Delete
$full_match = $regex[0];
[2621] Fix | Delete
$has_leading_slash = ! empty( $regex[1] );
[2622] Fix | Delete
$tag_name = $regex[2];
[2623] Fix | Delete
$tag = strtolower( $tag_name );
[2624] Fix | Delete
$is_single_tag = in_array( $tag, $single_tags, true );
[2625] Fix | Delete
$pre_attribute_ws = isset( $regex[4] ) ? $regex[4] : '';
[2626] Fix | Delete
$attributes = trim( isset( $regex[5] ) ? $regex[5] : $regex[3] );
[2627] Fix | Delete
$has_self_closer = str_ends_with( $attributes, '/' );
[2628] Fix | Delete
[2629] Fix | Delete
$newtext .= $tagqueue;
[2630] Fix | Delete
[2631] Fix | Delete
$i = strpos( $text, $full_match );
[2632] Fix | Delete
$l = strlen( $full_match );
[2633] Fix | Delete
[2634] Fix | Delete
// Clear the shifter.
[2635] Fix | Delete
$tagqueue = '';
[2636] Fix | Delete
if ( $has_leading_slash ) { // End tag.
[2637] Fix | Delete
// If too many closing tags.
[2638] Fix | Delete
if ( $stacksize <= 0 ) {
[2639] Fix | Delete
$tag = '';
[2640] Fix | Delete
// Or close to be safe $tag = '/' . $tag.
[2641] Fix | Delete
[2642] Fix | Delete
// If stacktop value = tag close value, then pop.
[2643] Fix | Delete
} elseif ( $tagstack[ $stacksize - 1 ] === $tag ) { // Found closing tag.
[2644] Fix | Delete
$tag = '</' . $tag . '>'; // Close tag.
[2645] Fix | Delete
array_pop( $tagstack );
[2646] Fix | Delete
--$stacksize;
[2647] Fix | Delete
} else { // Closing tag not at top, search for it.
[2648] Fix | Delete
for ( $j = $stacksize - 1; $j >= 0; $j-- ) {
[2649] Fix | Delete
if ( $tagstack[ $j ] === $tag ) {
[2650] Fix | Delete
// Add tag to tagqueue.
[2651] Fix | Delete
for ( $k = $stacksize - 1; $k >= $j; $k-- ) {
[2652] Fix | Delete
$tagqueue .= '</' . array_pop( $tagstack ) . '>';
[2653] Fix | Delete
--$stacksize;
[2654] Fix | Delete
}
[2655] Fix | Delete
break;
[2656] Fix | Delete
}
[2657] Fix | Delete
}
[2658] Fix | Delete
$tag = '';
[2659] Fix | Delete
}
[2660] Fix | Delete
} else { // Begin tag.
[2661] Fix | Delete
if ( $has_self_closer ) {
[2662] Fix | Delete
/*
[2663] Fix | Delete
* If it presents itself as a self-closing tag, but it isn't a known single-entity self-closing tag,
[2664] Fix | Delete
* then don't let it be treated as such and immediately close it with a closing tag.
[2665] Fix | Delete
* The tag will encapsulate no text as a result.
[2666] Fix | Delete
*/
[2667] Fix | Delete
if ( ! $is_single_tag ) {
[2668] Fix | Delete
$attributes = trim( substr( $attributes, 0, -1 ) ) . "></$tag";
[2669] Fix | Delete
}
[2670] Fix | Delete
} elseif ( $is_single_tag ) {
[2671] Fix | Delete
// Else if it's a known single-entity tag but it doesn't close itself, do so.
[2672] Fix | Delete
$pre_attribute_ws = ' ';
[2673] Fix | Delete
$attributes .= '/';
[2674] Fix | Delete
} else {
[2675] Fix | Delete
/*
[2676] Fix | Delete
* It's not a single-entity tag.
[2677] Fix | Delete
* If the top of the stack is the same as the tag we want to push, close previous tag.
[2678] Fix | Delete
*/
[2679] Fix | Delete
if ( $stacksize > 0 && ! in_array( $tag, $nestable_tags, true ) && $tagstack[ $stacksize - 1 ] === $tag ) {
[2680] Fix | Delete
$tagqueue = '</' . array_pop( $tagstack ) . '>';
[2681] Fix | Delete
--$stacksize;
[2682] Fix | Delete
}
[2683] Fix | Delete
$stacksize = array_push( $tagstack, $tag );
[2684] Fix | Delete
}
[2685] Fix | Delete
[2686] Fix | Delete
// Attributes.
[2687] Fix | Delete
if ( $has_self_closer && $is_single_tag ) {
[2688] Fix | Delete
// We need some space - avoid <br/> and prefer <br />.
[2689] Fix | Delete
$pre_attribute_ws = ' ';
[2690] Fix | Delete
}
[2691] Fix | Delete
[2692] Fix | Delete
$tag = '<' . $tag . $pre_attribute_ws . $attributes . '>';
[2693] Fix | Delete
// If already queuing a close tag, then put this tag on too.
[2694] Fix | Delete
if ( ! empty( $tagqueue ) ) {
[2695] Fix | Delete
$tagqueue .= $tag;
[2696] Fix | Delete
$tag = '';
[2697] Fix | Delete
}
[2698] Fix | Delete
}
[2699] Fix | Delete
$newtext .= substr( $text, 0, $i ) . $tag;
[2700] Fix | Delete
$text = substr( $text, $i + $l );
[2701] Fix | Delete
}
[2702] Fix | Delete
[2703] Fix | Delete
// Clear tag queue.
[2704] Fix | Delete
$newtext .= $tagqueue;
[2705] Fix | Delete
[2706] Fix | Delete
// Add remaining text.
[2707] Fix | Delete
$newtext .= $text;
[2708] Fix | Delete
[2709] Fix | Delete
while ( $x = array_pop( $tagstack ) ) {
[2710] Fix | Delete
$newtext .= '</' . $x . '>'; // Add remaining tags to close.
[2711] Fix | Delete
}
[2712] Fix | Delete
[2713] Fix | Delete
// WP fix for the bug with HTML comments.
[2714] Fix | Delete
$newtext = str_replace( '< !--', '<!--', $newtext );
[2715] Fix | Delete
$newtext = str_replace( '< !--', '< !--', $newtext );
[2716] Fix | Delete
[2717] Fix | Delete
return $newtext;
[2718] Fix | Delete
}
[2719] Fix | Delete
[2720] Fix | Delete
/**
[2721] Fix | Delete
* Acts on text which is about to be edited.
[2722] Fix | Delete
*
[2723] Fix | Delete
* The $content is run through esc_textarea(), which uses htmlspecialchars()
[2724] Fix | Delete
* to convert special characters to HTML entities. If `$richedit` is set to true,
[2725] Fix | Delete
* it is simply a holder for the {@see 'format_to_edit'} filter.
[2726] Fix | Delete
*
[2727] Fix | Delete
* @since 0.71
[2728] Fix | Delete
* @since 4.4.0 The `$richedit` parameter was renamed to `$rich_text` for clarity.
[2729] Fix | Delete
*
[2730] Fix | Delete
* @param string $content The text about to be edited.
[2731] Fix | Delete
* @param bool $rich_text Optional. Whether `$content` should be considered rich text,
[2732] Fix | Delete
* in which case it would not be passed through esc_textarea().
[2733] Fix | Delete
* Default false.
[2734] Fix | Delete
* @return string The text after the filter (and possibly htmlspecialchars()) has been run.
[2735] Fix | Delete
*/
[2736] Fix | Delete
function format_to_edit( $content, $rich_text = false ) {
[2737] Fix | Delete
/**
[2738] Fix | Delete
* Filters the text to be formatted for editing.
[2739] Fix | Delete
*
[2740] Fix | Delete
* @since 1.2.0
[2741] Fix | Delete
*
[2742] Fix | Delete
* @param string $content The text, prior to formatting for editing.
[2743] Fix | Delete
*/
[2744] Fix | Delete
$content = apply_filters( 'format_to_edit', $content );
[2745] Fix | Delete
if ( ! $rich_text ) {
[2746] Fix | Delete
$content = esc_textarea( $content );
[2747] Fix | Delete
}
[2748] Fix | Delete
return $content;
[2749] Fix | Delete
}
[2750] Fix | Delete
[2751] Fix | Delete
/**
[2752] Fix | Delete
* Add leading zeros when necessary.
[2753] Fix | Delete
*
[2754] Fix | Delete
* If you set the threshold to '4' and the number is '10', then you will get
[2755] Fix | Delete
* back '0010'. If you set the threshold to '4' and the number is '5000', then you
[2756] Fix | Delete
* will get back '5000'.
[2757] Fix | Delete
*
[2758] Fix | Delete
* Uses sprintf to append the amount of zeros based on the $threshold parameter
[2759] Fix | Delete
* and the size of the number. If the number is large enough, then no zeros will
[2760] Fix | Delete
* be appended.
[2761] Fix | Delete
*
[2762] Fix | Delete
* @since 0.71
[2763] Fix | Delete
*
[2764] Fix | Delete
* @param int $number Number to append zeros to if not greater than threshold.
[2765] Fix | Delete
* @param int $threshold Digit places number needs to be to not have zeros added.
[2766] Fix | Delete
* @return string Adds leading zeros to number if needed.
[2767] Fix | Delete
*/
[2768] Fix | Delete
function zeroise( $number, $threshold ) {
[2769] Fix | Delete
return sprintf( '%0' . $threshold . 's', $number );
[2770] Fix | Delete
}
[2771] Fix | Delete
[2772] Fix | Delete
/**
[2773] Fix | Delete
* Adds backslashes before letters and before a number at the start of a string.
[2774] Fix | Delete
*
[2775] Fix | Delete
* @since 0.71
[2776] Fix | Delete
*
[2777] Fix | Delete
* @param string $value Value to which backslashes will be added.
[2778] Fix | Delete
* @return string String with backslashes inserted.
[2779] Fix | Delete
*/
[2780] Fix | Delete
function backslashit( $value ) {
[2781] Fix | Delete
if ( isset( $value[0] ) && $value[0] >= '0' && $value[0] <= '9' ) {
[2782] Fix | Delete
$value = '\\\\' . $value;
[2783] Fix | Delete
}
[2784] Fix | Delete
return addcslashes( $value, 'A..Za..z' );
[2785] Fix | Delete
}
[2786] Fix | Delete
[2787] Fix | Delete
/**
[2788] Fix | Delete
* Appends a trailing slash.
[2789] Fix | Delete
*
[2790] Fix | Delete
* Will remove trailing forward and backslashes if it exists already before adding
[2791] Fix | Delete
* a trailing forward slash. This prevents double slashing a string or path.
[2792] Fix | Delete
*
[2793] Fix | Delete
* The primary use of this is for paths and thus should be used for paths. It is
[2794] Fix | Delete
* not restricted to paths and offers no specific path support.
[2795] Fix | Delete
*
[2796] Fix | Delete
* @since 1.2.0
[2797] Fix | Delete
*
[2798] Fix | Delete
* @param string $value Value to which trailing slash will be added.
[2799] Fix | Delete
* @return string String with trailing slash added.
[2800] Fix | Delete
*/
[2801] Fix | Delete
function trailingslashit( $value ) {
[2802] Fix | Delete
return untrailingslashit( $value ) . '/';
[2803] Fix | Delete
}
[2804] Fix | Delete
[2805] Fix | Delete
/**
[2806] Fix | Delete
* Removes trailing forward slashes and backslashes if they exist.
[2807] Fix | Delete
*
[2808] Fix | Delete
* The primary use of this is for paths and thus should be used for paths. It is
[2809] Fix | Delete
* not restricted to paths and offers no specific path support.
[2810] Fix | Delete
*
[2811] Fix | Delete
* @since 2.2.0
[2812] Fix | Delete
*
[2813] Fix | Delete
* @param string $text Value from which trailing slashes will be removed.
[2814] Fix | Delete
* @return string String without the trailing slashes.
[2815] Fix | Delete
*/
[2816] Fix | Delete
function untrailingslashit( $value ) {
[2817] Fix | Delete
return rtrim( $value, '/\\' );
[2818] Fix | Delete
}
[2819] Fix | Delete
[2820] Fix | Delete
/**
[2821] Fix | Delete
* Adds slashes to a string or recursively adds slashes to strings within an array.
[2822] Fix | Delete
*
[2823] Fix | Delete
* @since 0.71
[2824] Fix | Delete
*
[2825] Fix | Delete
* @param string|array $gpc String or array of data to slash.
[2826] Fix | Delete
* @return string|array Slashed `$gpc`.
[2827] Fix | Delete
*/
[2828] Fix | Delete
function addslashes_gpc( $gpc ) {
[2829] Fix | Delete
return wp_slash( $gpc );
[2830] Fix | Delete
}
[2831] Fix | Delete
[2832] Fix | Delete
/**
[2833] Fix | Delete
* Navigates through an array, object, or scalar, and removes slashes from the values.
[2834] Fix | Delete
*
[2835] Fix | Delete
* @since 2.0.0
[2836] Fix | Delete
*
[2837] Fix | Delete
* @param mixed $value The value to be stripped.
[2838] Fix | Delete
* @return mixed Stripped value.
[2839] Fix | Delete
*/
[2840] Fix | Delete
function stripslashes_deep( $value ) {
[2841] Fix | Delete
return map_deep( $value, 'stripslashes_from_strings_only' );
[2842] Fix | Delete
}
[2843] Fix | Delete
[2844] Fix | Delete
/**
[2845] Fix | Delete
* Callback function for `stripslashes_deep()` which strips slashes from strings.
[2846] Fix | Delete
*
[2847] Fix | Delete
* @since 4.4.0
[2848] Fix | Delete
*
[2849] Fix | Delete
* @param mixed $value The array or string to be stripped.
[2850] Fix | Delete
* @return mixed The stripped value.
[2851] Fix | Delete
*/
[2852] Fix | Delete
function stripslashes_from_strings_only( $value ) {
[2853] Fix | Delete
return is_string( $value ) ? stripslashes( $value ) : $value;
[2854] Fix | Delete
}
[2855] Fix | Delete
[2856] Fix | Delete
/**
[2857] Fix | Delete
* Navigates through an array, object, or scalar, and encodes the values to be used in a URL.
[2858] Fix | Delete
*
[2859] Fix | Delete
* @since 2.2.0
[2860] Fix | Delete
*
[2861] Fix | Delete
* @param mixed $value The array or string to be encoded.
[2862] Fix | Delete
* @return mixed The encoded value.
[2863] Fix | Delete
*/
[2864] Fix | Delete
function urlencode_deep( $value ) {
[2865] Fix | Delete
return map_deep( $value, 'urlencode' );
[2866] Fix | Delete
}
[2867] Fix | Delete
[2868] Fix | Delete
/**
[2869] Fix | Delete
* Navigates through an array, object, or scalar, and raw-encodes the values to be used in a URL.
[2870] Fix | Delete
*
[2871] Fix | Delete
* @since 3.4.0
[2872] Fix | Delete
*
[2873] Fix | Delete
* @param mixed $value The array or string to be encoded.
[2874] Fix | Delete
* @return mixed The encoded value.
[2875] Fix | Delete
*/
[2876] Fix | Delete
function rawurlencode_deep( $value ) {
[2877] Fix | Delete
return map_deep( $value, 'rawurlencode' );
[2878] Fix | Delete
}
[2879] Fix | Delete
[2880] Fix | Delete
/**
[2881] Fix | Delete
* Navigates through an array, object, or scalar, and decodes URL-encoded values
[2882] Fix | Delete
*
[2883] Fix | Delete
* @since 4.4.0
[2884] Fix | Delete
*
[2885] Fix | Delete
* @param mixed $value The array or string to be decoded.
[2886] Fix | Delete
* @return mixed The decoded value.
[2887] Fix | Delete
*/
[2888] Fix | Delete
function urldecode_deep( $value ) {
[2889] Fix | Delete
return map_deep( $value, 'urldecode' );
[2890] Fix | Delete
}
[2891] Fix | Delete
[2892] Fix | Delete
/**
[2893] Fix | Delete
* Converts email addresses characters to HTML entities to block spam bots.
[2894] Fix | Delete
*
[2895] Fix | Delete
* @since 0.71
[2896] Fix | Delete
*
[2897] Fix | Delete
* @param string $email_address Email address.
[2898] Fix | Delete
* @param int $hex_encoding Optional. Set to 1 to enable hex encoding.
[2899] Fix | Delete
* @return string Converted email address.
[2900] Fix | Delete
*/
[2901] Fix | Delete
function antispambot( $email_address, $hex_encoding = 0 ) {
[2902] Fix | Delete
$email_no_spam_address = '';
[2903] Fix | Delete
[2904] Fix | Delete
for ( $i = 0, $len = strlen( $email_address ); $i < $len; $i++ ) {
[2905] Fix | Delete
$j = rand( 0, 1 + $hex_encoding );
[2906] Fix | Delete
[2907] Fix | Delete
if ( 0 === $j ) {
[2908] Fix | Delete
$email_no_spam_address .= '&#' . ord( $email_address[ $i ] ) . ';';
[2909] Fix | Delete
} elseif ( 1 === $j ) {
[2910] Fix | Delete
$email_no_spam_address .= $email_address[ $i ];
[2911] Fix | Delete
} elseif ( 2 === $j ) {
[2912] Fix | Delete
$email_no_spam_address .= '%' . zeroise( dechex( ord( $email_address[ $i ] ) ), 2 );
[2913] Fix | Delete
}
[2914] Fix | Delete
}
[2915] Fix | Delete
[2916] Fix | Delete
return str_replace( '@', '&#64;', $email_no_spam_address );
[2917] Fix | Delete
}
[2918] Fix | Delete
[2919] Fix | Delete
/**
[2920] Fix | Delete
* Callback to convert URI match to HTML A element.
[2921] Fix | Delete
*
[2922] Fix | Delete
* This function was backported from 2.5.0 to 2.3.2. Regex callback for make_clickable().
[2923] Fix | Delete
*
[2924] Fix | Delete
* @since 2.3.2
[2925] Fix | Delete
* @access private
[2926] Fix | Delete
*
[2927] Fix | Delete
* @param array $matches Single Regex Match.
[2928] Fix | Delete
* @return string HTML A element with URI address.
[2929] Fix | Delete
*/
[2930] Fix | Delete
function _make_url_clickable_cb( $matches ) {
[2931] Fix | Delete
$url = $matches[2];
[2932] Fix | Delete
[2933] Fix | Delete
if ( ')' === $matches[3] && strpos( $url, '(' ) ) {
[2934] Fix | Delete
/*
[2935] Fix | Delete
* If the trailing character is a closing parenthesis, and the URL has an opening parenthesis in it,
[2936] Fix | Delete
* add the closing parenthesis to the URL. Then we can let the parenthesis balancer do its thing below.
[2937] Fix | Delete
*/
[2938] Fix | Delete
$url .= $matches[3];
[2939] Fix | Delete
$suffix = '';
[2940] Fix | Delete
} else {
[2941] Fix | Delete
$suffix = $matches[3];
[2942] Fix | Delete
}
[2943] Fix | Delete
[2944] Fix | Delete
// Include parentheses in the URL only if paired.
[2945] Fix | Delete
while ( substr_count( $url, '(' ) < substr_count( $url, ')' ) ) {
[2946] Fix | Delete
$suffix = strrchr( $url, ')' ) . $suffix;
[2947] Fix | Delete
$url = substr( $url, 0, strrpos( $url, ')' ) );
[2948] Fix | Delete
}
[2949] Fix | Delete
[2950] Fix | Delete
$url = esc_url( $url );
[2951] Fix | Delete
if ( empty( $url ) ) {
[2952] Fix | Delete
return $matches[0];
[2953] Fix | Delete
}
[2954] Fix | Delete
[2955] Fix | Delete
$rel_attr = _make_clickable_rel_attr( $url );
[2956] Fix | Delete
[2957] Fix | Delete
return $matches[1] . "<a href=\"{$url}\"{$rel_attr}>{$url}</a>" . $suffix;
[2958] Fix | Delete
}
[2959] Fix | Delete
[2960] Fix | Delete
/**
[2961] Fix | Delete
* Callback to convert URL match to HTML A element.
[2962] Fix | Delete
*
[2963] Fix | Delete
* This function was backported from 2.5.0 to 2.3.2. Regex callback for make_clickable().
[2964] Fix | Delete
*
[2965] Fix | Delete
* @since 2.3.2
[2966] Fix | Delete
* @access private
[2967] Fix | Delete
*
[2968] Fix | Delete
* @param array $matches Single Regex Match.
[2969] Fix | Delete
* @return string HTML A element with URL address.
[2970] Fix | Delete
*/
[2971] Fix | Delete
function _make_web_ftp_clickable_cb( $matches ) {
[2972] Fix | Delete
$ret = '';
[2973] Fix | Delete
$dest = $matches[2];
[2974] Fix | Delete
$dest = 'http://' . $dest;
[2975] Fix | Delete
[2976] Fix | Delete
// Removed trailing [.,;:)] from URL.
[2977] Fix | Delete
$last_char = substr( $dest, -1 );
[2978] Fix | Delete
if ( in_array( $last_char, array( '.', ',', ';', ':', ')' ), true ) === true ) {
[2979] Fix | Delete
$ret = $last_char;
[2980] Fix | Delete
$dest = substr( $dest, 0, strlen( $dest ) - 1 );
[2981] Fix | Delete
}
[2982] Fix | Delete
[2983] Fix | Delete
$dest = esc_url( $dest );
[2984] Fix | Delete
if ( empty( $dest ) ) {
[2985] Fix | Delete
return $matches[0];
[2986] Fix | Delete
}
[2987] Fix | Delete
[2988] Fix | Delete
$rel_attr = _make_clickable_rel_attr( $dest );
[2989] Fix | Delete
[2990] Fix | Delete
return $matches[1] . "<a href=\"{$dest}\"{$rel_attr}>{$dest}</a>{$ret}";
[2991] Fix | Delete
}
[2992] Fix | Delete
[2993] Fix | Delete
/**
[2994] Fix | Delete
* Callback to convert email address match to HTML A element.
[2995] Fix | Delete
*
[2996] Fix | Delete
* This function was backported from 2.5.0 to 2.3.2. Regex callback for make_clickable().
[2997] Fix | Delete
*
[2998] Fix | Delete
* @since 2.3.2
[2999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function