Ticket #5638: 5638.r8781.diff
| File 5638.r8781.diff, 21.7 KB (added by , 17 years ago) |
|---|
-
formatting.php
10 10 /** 11 11 * Replaces common plain text characters into formatted entities 12 12 * 13 * As an example, 13 * As an example, 14 14 * <code> 15 15 * 'cause today's effort makes it worth tomorrow's "holiday"... 16 16 * </code> … … 51 51 $dynamic_replacements = array('’$1','$1‘', '$1″', '$1′', '$1’$2', '$1“$2', '”$1', '’$1', '$1×$2'); 52 52 53 53 for ( $i = 0; $i < $stop; $i++ ) { 54 $curl = $textarr[$i];54 $curl = $textarr[$i]; 55 55 56 56 if ( !empty($curl) && '<' != $curl{0} && '[' != $curl{0} && $next && !$has_pre_parent) { // If it's not a tag 57 57 // static strings … … 72 72 $output .= $curl; 73 73 } 74 74 75 return $output;75 return $output; 76 76 } 77 77 78 78 /** … … 105 105 * A group of regex replaces used to identify text formatted with newlines and 106 106 * replace double line-breaks with HTML paragraph tags. The remaining 107 107 * line-breaks after conversion become <<br />> tags, unless $br is set to '0' 108 * or 'false'.108 * or 'false'. 109 109 * 110 110 * @since 0.71 111 111 * … … 154 154 /** 155 155 * Checks to see if a string is utf8 encoded. 156 156 * 157 * {@internal Missing Long Description}}158 *159 157 * @since 1.2.1 160 158 * 161 159 * @param string $Str The string to be checked … … 183 181 * Converts a number of special characters into their HTML entities. 184 182 * 185 183 * Differs from htmlspecialchars as existing HTML entities will not be encoded. 186 * Specific ically changes: & to &, < to < and > to >.184 * Specifically changes: & to &, < to < and > to >. 187 185 * 188 186 * $quotes can be set to 'single' to encode ' to ', 'double' to encode " to 189 187 * ", or '1' to do both. Default is 0 where no quotes are encoded. … … 267 265 /** 268 266 * Replaces accents in a string. 269 267 * 270 * {@internal Missing Long Description}}271 *272 268 * @since 1.2.1 273 269 * 274 270 * @param string $string The text to be filtered. … … 423 419 $name = preg_replace('|-+|', '-', $name); 424 420 $name = trim($name, '-'); 425 421 return $name; 426 427 422 } 428 423 429 424 /** 430 * Removes characters from the username.425 * Sanitize username stripping out unsafe characters. 431 426 * 432 427 * If $strict is true, only alphanumeric characters (as well as _, space, ., -, 433 428 * @) are returned. … … 456 451 } 457 452 458 453 /** 459 * Returns a string which has been sanitized.454 * Sanitizes title or use fallback title. 460 455 * 461 456 * Specifically, HTML and PHP tags are stripped. Further actions can be added 462 457 * via the plugin API. If $title is empty and $fallback_title is set, the latter … … 479 474 } 480 475 481 476 /** 482 * Replaces the string with safe characters. Whitespace becomes a dash.477 * Sanitizes title, replacing whitespace with dashes. 483 478 * 484 479 * Limits the output to alphanumeric characters, underscore (_) and dash (-). 480 * Whitespace becomes a dash. 485 481 * 486 482 * @since 1.2.0 487 483 * … … 603 599 /** 604 600 * Fixes javascript bugs in browsers. 605 601 * 606 * {@internal Missing Long Description}}602 * Converts unicode characters to HTML numbered entities. 607 603 * 608 604 * @since 1.5.0 609 605 * @uses $is_macIE … … 616 612 // Fixes for browsers' javascript bugs 617 613 global $is_macIE, $is_winIE; 618 614 615 /** @todo use preg_replace_callback() instead */ 619 616 if ( $is_winIE || $is_macIE ) 620 617 $text = preg_replace("/\%u([0-9A-F]{4,4})/e", "'&#'.base_convert('\\1',16,10).';'", $text); 621 618 … … 623 620 } 624 621 625 622 /** 626 * balanceTags() - {@internal Missing Short Description}}623 * Will only balance the tags if forced to and the option is set to balance tags. 627 624 * 628 * {@internal Missing Long Description}} 625 * The option 'use_balanceTags' is used for whether the tags will be balanced. 626 * Both the $force parameter and 'use_balanceTags' option will have to be true 627 * before the tags will be balanced. 629 628 * 630 629 * @since 0.71 631 630 * … … 642 641 /** 643 642 * Balances tags of string using a modified stack. 644 643 * 645 * {@internal Missing Long Description}}646 *647 644 * @since 2.0.4 648 645 * 649 646 * @author Leonard Lin <leonard@acm.org> 650 647 * @license GPL v2.0 651 * @ dateNovember 4, 2001648 * @copyright November 4, 2001 652 649 * @version 1.1 653 650 * @todo Make better - change loop condition to $text in 1.2 654 651 * @internal Modified by Scott Reilly (coffee2code) 02 Aug 2004 … … 781 778 /** 782 779 * Holder for the 'format_to_post' filter. 783 780 * 784 * {@internal Deprecated? Unused in 2.6}}785 *786 781 * @since 0.71 787 782 * 788 783 * @param string $content The text to pass through the filter. … … 796 791 /** 797 792 * Add leading zeros when necessary. 798 793 * 799 * {@internal Missing Long Description}} 794 * If you set the threshold to '4' and the number is '10', then you will get 795 * back '0010'. If you set the number to '4' and the number is '5000', then you 796 * will get back '5000'. 800 797 * 801 798 * @since 0.71 802 799 * … … 804 801 * @param int $threshold Amount of digits 805 802 * @return string Adds leading zeros to number if needed 806 803 */ 807 function zeroise($number, $threshold) {804 function zeroise($number, $threshold) { 808 805 return sprintf('%0'.$threshold.'s', $number); 809 806 } 810 807 811 808 /** 812 809 * Adds backslashes before letters and before a number at the start of a string. 813 810 * 814 * {@internal Missing Long Description}}815 *816 811 * @since 0.71 817 812 * 818 813 * @param string $string Value to which backslashes will be added. … … 861 856 /** 862 857 * Adds slashes to escape strings. 863 858 * 864 * Slashes will first be removed if magic_quotes_gpc is set, 865 * see {@link http://www.php.net/magic_quotes} for more details.859 * Slashes will first be removed if magic_quotes_gpc is set, see {@link 860 * http://www.php.net/magic_quotes} for more details. 866 861 * 867 862 * @since 0.71 868 863 * … … 882 877 /** 883 878 * Navigates through an array and removes slashes from the values. 884 879 * 885 * If an array is passed, the array_map() function causes a callback to 886 * pass the value back to the function. The slashes from this value will 887 * removed. 880 * If an array is passed, the array_map() function causes a callback to pass the 881 * value back to the function. The slashes from this value will removed. 888 882 * 889 883 * @since 2.0.0 890 884 * … … 892 886 * @return array|string Stripped array (or string in the callback). 893 887 */ 894 888 function stripslashes_deep($value) { 895 $value = is_array($value) ? 896 array_map('stripslashes_deep', $value) : 897 stripslashes($value); 898 899 return $value; 889 $value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value); 890 return $value; 900 891 } 901 892 902 893 /** … … 911 902 * @return array|string $value The encoded array (or string from the callback). 912 903 */ 913 904 function urlencode_deep($value) { 914 $value = is_array($value) ? 915 array_map('urlencode_deep', $value) : 916 urlencode($value); 917 918 return $value; 905 $value = is_array($value) ? array_map('urlencode_deep', $value) : urlencode($value); 906 return $value; 919 907 } 920 908 921 909 /** … … 947 935 } 948 936 949 937 /** 950 * _make_url_clickable_cb() - {@internal Missing Short Description}}938 * Callback to convert URI match to HTML A element. 951 939 * 952 * {@internal Missing Long Description}} 940 * This function was backported from 2.5.0 to 2.3.2. Regex callback for {@link 941 * make_clickable()}. 953 942 * 954 * @since 2. 5.0943 * @since 2.3.2 955 944 * @access private 956 945 * 957 * @param unknown_type $matches958 * @return unknown946 * @param array $matches Single Regex Match. 947 * @return string HTML A element with URI address. 959 948 */ 960 949 function _make_url_clickable_cb($matches) { 961 950 $ret = ''; … … 972 961 } 973 962 974 963 /** 975 * _make_web_ftp_clickable_cb() - {@internal Missing Short Description}}964 * Callback to convert URL match to HTML A element. 976 965 * 977 * {@internal Missing Long Description}} 966 * This function was backported from 2.5.0 to 2.3.2. Regex callback for {@link 967 * make_clickable()}. 978 968 * 979 * @since 2. 5.0969 * @since 2.3.2 980 970 * @access private 981 971 * 982 * @param unknown_type $matches983 * @return unknown972 * @param array $matches Single Regex Match. 973 * @return string HTML A element with URL address. 984 974 */ 985 975 function _make_web_ftp_clickable_cb($matches) { 986 976 $ret = ''; … … 998 988 } 999 989 1000 990 /** 1001 * _make_email_clickable_cb() - {@internal Missing Short Description}}991 * Callback to convert email address match to HTML A element. 1002 992 * 1003 * {@internal Missing Long Description}} 993 * This function was backported from 2.5.0 to 2.3.2. Regex callback for {@link 994 * make_clickable()}. 1004 995 * 1005 * @since 2. 5.0996 * @since 2.3.2 1006 997 * @access private 1007 998 * 1008 * @param unknown_type $matches1009 * @return unknown999 * @param array $matches Single Regex Match. 1000 * @return string HTML A element with email address. 1010 1001 */ 1011 1002 function _make_email_clickable_cb($matches) { 1012 1003 $email = $matches[2] . '@' . $matches[3]; … … 1014 1005 } 1015 1006 1016 1007 /** 1017 * make_clickable() - {@internal Missing Short Description}}1008 * Convert plaintext URI to HTML links. 1018 1009 * 1019 * {@internal Missing Long Description}} 1010 * Converts URI, www and ftp, and email addresses. Finishes by fixing links 1011 * within links. 1020 1012 * 1021 1013 * @since 0.71 1022 1014 * 1023 * @param unknown_type $ret1024 * @return unknown1015 * @param string $ret Content to convert URIs. 1016 * @return string Content with converted URIs. 1025 1017 */ 1026 1018 function make_clickable($ret) { 1027 1019 $ret = ' ' . $ret; … … 1077 1069 * 1078 1070 * @since 0.71 1079 1071 * 1080 * @param unknown_type$text1081 * @return unknown1072 * @param string $text 1073 * @return string 1082 1074 */ 1083 1075 function convert_smilies($text) { 1084 1076 global $wp_smiliessearch, $wp_smiliesreplace; … … 1104 1096 /** 1105 1097 * Checks to see if the text is a valid email address. 1106 1098 * 1107 * {@internal Missing Long Description}}1108 *1109 1099 * @since 0.71 1110 1100 * 1111 1101 * @param string $user_email The email address to be checked. … … 1125 1115 } 1126 1116 1127 1117 /** 1128 * wp_iso_descrambler() -{@internal Missing Short Description}}1118 * {@internal Missing Short Description}} 1129 1119 * 1130 1120 * {@internal Missing Long Description}} 1131 1121 * 1132 1122 * @since 1.2.0 1133 1123 * @usedby wp_mail() handles charsets in email subjects 1134 1124 * 1135 * @param unknown_type$string1136 * @return unknown1125 * @param string $string 1126 * @return string 1137 1127 */ 1138 1128 function wp_iso_descrambler($string) { 1139 1129 /* this may only work with iso-8859-1, I'm afraid */ … … 1141 1131 return $string; 1142 1132 } else { 1143 1133 $subject = str_replace('_', ' ', $matches[2]); 1134 /** @todo use preg_replace_callback() */ 1144 1135 $subject = preg_replace('#\=([0-9a-f]{2})#ei', "chr(hexdec(strtolower('$1')))", $subject); 1145 1136 return $subject; 1146 1137 } … … 1149 1140 /** 1150 1141 * Returns a date in the GMT equivalent. 1151 1142 * 1152 * Requires and returns a date in the Y-m-d H:i:s format. 1153 * Simply subtracts thevalue of gmt_offset.1143 * Requires and returns a date in the Y-m-d H:i:s format. Simply subtracts the 1144 * value of gmt_offset. 1154 1145 * 1155 1146 * @since 1.2.0 1156 1147 * … … 1167 1158 /** 1168 1159 * Converts a GMT date into the correct format for the blog. 1169 1160 * 1170 * Requires and returns in the Y-m-d H:i:s format. Simply 1171 * adds the value ofgmt_offset.1161 * Requires and returns in the Y-m-d H:i:s format. Simply adds the value of 1162 * gmt_offset. 1172 1163 * 1173 1164 * @since 1.2.0 1174 1165 * … … 1185 1176 /** 1186 1177 * Computes an offset in seconds from an iso8601 timezone. 1187 1178 * 1188 * {@internal Missing Long Description}}1189 *1190 1179 * @since 1.5.0 1191 1180 * 1192 1181 * @param string $timezone Either 'Z' for 0 offset or '±hhmm'. … … 1208 1197 /** 1209 1198 * Converts an iso8601 date to MySQL DateTime format used by post_date[_gmt]. 1210 1199 * 1211 * {@internal Missing Long Description}}1212 *1213 1200 * @since 1.5.0 1214 1201 * 1215 1202 * @param string $date_string Date and time in ISO 8601 format {@link http://en.wikipedia.org/wiki/ISO_8601}. 1216 * @param unknown_type $timezone Optional. If set to GMT returns the time minus gmt_offset. Default USER.1203 * @param string $timezone Optional. If set to GMT returns the time minus gmt_offset. Default is 'user'. 1217 1204 * @return string The date and time in MySQL DateTime format - Y-m-d H:i:s. 1218 1205 */ 1219 1206 function iso8601_to_datetime($date_string, $timezone = USER) { 1220 1207 if ($timezone == GMT) { 1221 1208 1209 if ($timezone == 'gmt') { 1210 1222 1211 preg_match('#([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(Z|[\+|\-][0-9]{2,4}){0,1}#', $date_string, $date_bits); 1223 1212 1224 1213 if (!empty($date_bits[7])) { // we have a timezone, so let's compute an offset … … 1269 1258 /** 1270 1259 * Determines the difference between two timestamps. 1271 1260 * 1272 * The difference is returned in a human readable format such as 1273 * " 1 hour", "5 mins", "2 days".1261 * The difference is returned in a human readable format such as "1 hour", 1262 * "5 mins", "2 days". 1274 1263 * 1275 1264 * @since 1.5.0 1276 1265 * … … 1305 1294 } 1306 1295 1307 1296 /** 1308 * Generates an excerpt from the content if needed.1297 * Generates an excerpt from the content, if needed. 1309 1298 * 1310 * {@internal Missing Long Description}} 1299 * The excerpt word amount will be 55 words and if the amount is greater than 1300 * that, then the string '[...]' will be appended to the excerpt. If the string 1301 * is less than 55 words, then the content will be returned as is. 1311 1302 * 1312 1303 * @since 1.5.0 1313 1304 * 1314 1305 * @param string $text The exerpt. If set to empty an excerpt is generated. 1315 1306 * @return string The excerpt. 1316 1307 */ 1317 function wp_trim_excerpt($text) { // Fakes an excerpt if needed1308 function wp_trim_excerpt($text) { 1318 1309 if ( '' == $text ) { 1319 1310 $text = get_the_content(''); 1320 1311 … … 1337 1328 /** 1338 1329 * Converts named entities into numbered entities. 1339 1330 * 1340 * {@internal Missing Long Description}}1341 *1342 1331 * @since 1.5.1 1343 1332 * 1344 1333 * @param string $text The text within which entities will be converted. 1345 * @return string Text with converted entities. 1334 * @return string Text with converted entities. 1346 1335 */ 1347 1336 function ent2ncr($text) { 1348 1337 $to_ncr = array( … … 1609 1598 } 1610 1599 1611 1600 /** 1612 * Formats text for the rich text editor and applies filter.1601 * Formats text for the rich text editor. 1613 1602 * 1614 * The filter 'richedit_pre' is applied here. If $text is empty 1615 * the filter willbe applied to an empty string.1603 * The filter 'richedit_pre' is applied here. If $text is empty the filter will 1604 * be applied to an empty string. 1616 1605 * 1617 1606 * @since 2.0.0 1618 1607 * … … 1631 1620 } 1632 1621 1633 1622 /** 1634 * Formats text for the HTML editor and applies a filter.1623 * Formats text for the HTML editor. 1635 1624 * 1636 * Unless $output is empty it will pass through htmlspecialchars 1637 * before the'htmledit_pre' filter is applied.1625 * Unless $output is empty it will pass through htmlspecialchars before the 1626 * 'htmledit_pre' filter is applied. 1638 1627 * 1639 * @since unknown1628 * @since 2.5.0 1640 1629 * 1641 1630 * @param string $output The text to be formatted. 1642 1631 * @return string Formatted text after filter applied. … … 1649 1638 } 1650 1639 1651 1640 /** 1652 * Checks and cleans a URL. 1641 * Checks and cleans a URL. 1653 1642 * 1654 * A number of characters are removed from the URL. If the URL is 1655 * for displaying (the default behaviour) amperstands are also replaced.1656 * The 'clean_url' filteris applied to the returned cleaned URL.1643 * A number of characters are removed from the URL. If the URL is for displaying 1644 * (the default behaviour) amperstands are also replaced. The 'clean_url' filter 1645 * is applied to the returned cleaned URL. 1657 1646 * 1658 1647 * @since 1.2.0 1659 1648 * @uses wp_kses_bad_protocol() To only permit protocols in the URL set 1660 * via $protocols or the common ones set in the function.1649 * via $protocols or the common ones set in the function. 1661 1650 * 1662 1651 * @param string $url The URL to be cleaned. 1663 * @param array $protocols Optional. An array of acceptable protocols. 1664 * Defaults to 'http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet' if not set.1665 * @param string $context Optional. How the URL will be used. Default is 'display'. 1652 * @param array $protocols Optional. An array of acceptable protocols. 1653 * Defaults to 'http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet' if not set. 1654 * @param string $context Optional. How the URL will be used. Default is 'display'. 1666 1655 * @return string The cleaned $url after the 'cleaned_url' filter is applied. 1667 1656 */ 1668 1657 function clean_url( $url, $protocols = null, $context = 'display' ) { … … 1711 1700 /** 1712 1701 * Convert entities, while preserving already-encoded entities. 1713 1702 * 1714 * {@internal Missing Long Description}}1715 *1716 1703 * @link http://www.php.net/htmlentities Borrowed from the PHP Manual user notes. 1717 1704 * 1718 1705 * @since 1.2.2 … … 1746 1733 /** 1747 1734 * Escaping for HTML attributes. 1748 1735 * 1749 * @since unknown1736 * @since 2.0.6 1750 1737 * 1751 1738 * @param string $text 1752 1739 * @return string … … 1759 1746 /** 1760 1747 * Escape a HTML tag name. 1761 1748 * 1762 * @since unknown1749 * @since 2.5.0 1763 1750 * 1764 1751 * @param string $tag_name 1765 1752 * @return string … … 1772 1759 /** 1773 1760 * Escapes text for SQL LIKE special characters % and _. 1774 1761 * 1775 * @since unknown1762 * @since 2.5.0 1776 1763 * 1777 1764 * @param string $text The text to be escaped. 1778 1765 * @return string text, safe for inclusion in LIKE query. … … 1782 1769 } 1783 1770 1784 1771 /** 1785 * {@internal Missing Short Description}}1772 * Convert full URL paths to absolute paths. 1786 1773 * 1787 * @since unknown 1774 * Removes the http or https protocols and the domain. Keeps the path '/' at the 1775 * beginning, so it isn't a true relative link, but from the web root base. 1788 1776 * 1789 * @param string $link 1790 * @return string 1777 * @since 2.1.0 1778 * 1779 * @param string $link Full URL path. 1780 * @return string Absolute path. 1791 1781 */ 1792 1782 function wp_make_link_relative( $link ) { 1793 return preg_replace( '|https?://[^/]+(/.*)|i', '$1', $link );1783 return preg_replace( '|https?://[^/]+(/.*)|i', '$1', $link ); 1794 1784 } 1795 1785 1796 1786 /** 1797 1787 * Sanitises various option values based on the nature of the option. 1798 1788 * 1799 * This is basically a switch statement which will pass $value through 1800 * a numberof functions depending on the $option.1789 * This is basically a switch statement which will pass $value through a number 1790 * of functions depending on the $option. 1801 1791 * 1802 1792 * @since 2.0.5 1803 1793 * … … 1805 1795 * @param string $value The unsanitised value. 1806 1796 * @return string Sanitized value. 1807 1797 */ 1808 function sanitize_option($option, $value) { // Remember to call stripslashes!1798 function sanitize_option($option, $value) { 1809 1799 1810 1800 switch ($option) { 1811 1801 case 'admin_email': … … 1882 1872 /** 1883 1873 * Parses a string into variables to be stored in an array. 1884 1874 * 1885 * Uses {@link http://www.php.net/parse_str parse_str()} and stripslashes 1886 * if{@link http://www.php.net/magic_quotes magic_quotes_gpc} is on.1875 * Uses {@link http://www.php.net/parse_str parse_str()} and stripslashes if 1876 * {@link http://www.php.net/magic_quotes magic_quotes_gpc} is on. 1887 1877 * 1888 1878 * @since 2.2.1 1889 1879 * @uses apply_filters() for the 'wp_parse_str' filter. … … 1901 1891 /** 1902 1892 * Convert lone less than signs. 1903 1893 * 1904 * KSES already converts lone greater than signs. 1894 * KSES already converts lone greater than signs. 1905 1895 * 1906 1896 * @uses wp_pre_kses_less_than_callback in the callback function. 1907 * @since unknown1897 * @since 2.3.0 1908 1898 * 1909 1899 * @param string $text Text to be converted. 1910 1900 * @return string Converted text. … … 1916 1906 /** 1917 1907 * Callback function used by preg_replace. 1918 1908 * 1919 * @since unknown1920 1909 * @uses wp_specialchars to format the $matches text. 1910 * @since 2.3.0 1921 1911 * 1922 1912 * @param array $matches Populated by matches to preg_replace. 1923 1913 * @return string The text returned after wp_specialchars if needed. … … 1931 1921 /** 1932 1922 * WordPress implementation of PHP sprintf() with filters. 1933 1923 * 1934 * @since unknown1924 * @since 2.5.0 1935 1925 * @link http://www.php.net/sprintf 1936 1926 * 1937 1927 * @param string $pattern The string which formatted args are inserted. … … 1991 1981 } 1992 1982 1993 1983 /** 1994 * L ist specifier %l for wp_sprintf.1984 * Localize list items before the rest of the content. 1995 1985 * 1996 * @since unknown 1986 * The '%l' must be at the first characters can then contain the rest of the 1987 * content. The list items will have ', ', ', and', and ' and ' added depending 1988 * on the amount of list items in the $args parameter. 1997 1989 * 1998 * @param unknown_type $pattern 1999 * @param unknown_type $args 2000 * @return unknown 1990 * @since 2.5.0 1991 * 1992 * @param string $pattern Content containing '%l' at the beginning. 1993 * @param array $args List items to prepend to the content and replace '%l'. 1994 * @return string Localized list items and rest of the content. 2001 1995 */ 2002 1996 function wp_sprintf_l($pattern, $args) { 2003 1997 // Not a match … … 2037 2031 * be counted as one character. For example & will be counted as 4, < as 2038 2032 * 3, etc. 2039 2033 * 2034 * @since 2.5.0 2035 * 2040 2036 * @param integer $str String to get the excerpt from. 2041 2037 * @param integer $count Maximum number of characters to take. 2042 2038 * @return string The excerpt. … … 2052 2048 /** 2053 2049 * Add a Base url to relative links in passed content. 2054 2050 * 2055 * By default it supports the 'src' and 'href' attributes ,2056 * However this may bechanged via the 3rd param.2051 * By default it supports the 'src' and 'href' attributes. However this can be 2052 * changed via the 3rd param. 2057 2053 * 2058 * @package WordPress 2059 * @since 2.7 2054 * @since 2.7.0 2060 2055 * 2061 2056 * @param string $content String to search for links in. 2062 2057 * @param string $base The base URL to prefix to links. … … 2073 2068 /** 2074 2069 * Callback to add a base url to relative links in passed content. 2075 2070 * 2071 * @since 2.7.0 2072 * @access private 2076 2073 * 2077 * @package WordPress2078 * @since 2.72079 *2080 2074 * @param string $m The matched link. 2081 2075 * @param string $base The base URL to prefix to links. 2082 2076 * @return string The processed link. … … 2093 2087 /** 2094 2088 * Adds a Target attribute to all links in passed content. 2095 2089 * 2096 * This function by default only applies to <a> tags, 2097 * however this can be modified by the 3rd param. 2098 * NOTE: Any current target attributed will be striped and replaced. 2090 * This function by default only applies to <a> tags, however this can be 2091 * modified by the 3rd param. 2099 2092 * 2100 * @package WordPress 2101 * @since 2.7 2093 * <b>NOTE:</b> Any current target attributed will be striped and replaced. 2102 2094 * 2095 * @since 2.7.0 2096 * 2103 2097 * @param string $content String to search for links in. 2104 2098 * @param string $target The Target to add to the links. 2105 2099 * @param array $tags An array of tags to apply to. … … 2114 2108 /** 2115 2109 * Callback to add a target attribute to all links in passed content. 2116 2110 * 2111 * @since 2.7.0 2112 * @access private 2117 2113 * 2118 * @package WordPress2119 * @since 2.72120 *2121 2114 * @param string $m The matched link. 2122 2115 * @param string $target The Target to add to the links. 2123 2116 * @return string The processed link.