Changeset 1121
- Timestamp:
- 04/22/2004 07:41:57 AM (20 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions-formatting.php
r1118 r1121 2 2 3 3 function wptexturize($text) { 4 $output = ""; 5 $textarr = preg_split("/(<.*>)/Us", $text, -1, PREG_SPLIT_DELIM_CAPTURE); // capture the tags as well as in between 4 $output = ''; 5 // Capture tags and everything inside them 6 $textarr = preg_split("/(<.*>)/Us", $text, -1, PREG_SPLIT_DELIM_CAPTURE); 6 7 $stop = count($textarr); $next = true; // loop stuff 7 8 for ($i = 0; $i < $stop; $i++) { … … 31 32 $curl = preg_replace("/\(c\)/i", '©', $curl); 32 33 $curl = preg_replace("/\(r\)/i", '®', $curl); 33 $curl = preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', $curl);34 34 $curl = str_replace("''", '”', $curl); 35 35 … … 56 56 $pee = $pee . "\n"; // just to make things a little easier, pad the end 57 57 $pee = preg_replace('|<br />\s*<br />|', "\n\n", $pee); 58 $pee = preg_replace('!(<(?:table|thead|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|p|h[1-6])[^>]*>)!', "\n$1", $pee); // Space things out a little 59 $pee = preg_replace('!(</(?:table|thead|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|p|h[1-6])>)!', "$1\n", $pee); // Space things out a little 60 $pee = preg_replace("/(\r\n|\r)/", "\n", $pee); // cross-platform newlines 58 // Space things out a little 59 $pee = preg_replace('!(<(?:table|thead|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|p|h[1-6])[^>]*>)!', "\n$1", $pee); 60 $pee = preg_replace('!(</(?:table|thead|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|p|h[1-6])>)!', "$1\n", $pee); 61 $pee = str_replace(array("\r\n", "\r"), "\n", $pee); // cross-platform newlines 61 62 $pee = preg_replace("/\n\n+/", "\n\n", $pee); // take care of duplicates 62 63 $pee = preg_replace('/\n?(.+?)(?:\n\s*\n|\z)/s', "\t<p>$1</p>\n", $pee); // make paragraphs, including one at the end … … 72 73 $pee = preg_replace('!<br />(\s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)!', '$1', $pee); 73 74 $pee = preg_replace('!(<pre.*?>)(.*?)</pre>!ise', " stripslashes('$1') . clean_pre('$2') . '</pre>' ", $pee); 74 $pee = preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', $pee);75 75 76 76 return $pee; … … 88 88 } 89 89 90 function convert_chars($content, $flag='obsolete attribute left there for backwards compatibility') { 91 // html/unicode entities output 92 global $wp_htmltrans, $wp_htmltranswinuni; 93 94 // removes metadata tags 90 function convert_chars($content, $flag = 'obsolete') { 91 global $wp_htmltranswinuni; 92 93 // Remove metadata tags 95 94 $content = preg_replace('/<title>(.+?)<\/title>/','',$content); 96 95 $content = preg_replace('/<category>(.+?)<\/category>/','',$content); 97 // converts lone & characters into & (a.k.a. &) 98 $content = preg_replace('/&[^#](?![a-z]*;)/ie', '"&".substr("\0",1)', $content); 96 97 // Converts lone & characters into & (a.k.a. &) 98 $content = preg_replace('/&([^#])(?![a-z]{1,8};)/i', '&$1', $content); 99 100 // Fix Word pasting 99 101 $content = strtr($content, $wp_htmltranswinuni); 100 if (get_settings('use_htmltrans')) { 101 // converts HTML-entities to their display values in order to convert them again later 102 $content = preg_replace('/['.chr(127).'-'.chr(255).']/e', '"&#".ord(\'\0\').";"', $content ); 103 $content = strtr($content, $wp_htmltrans); 104 } 105 106 // you can delete these 2 lines if you don't like <br /> and <hr /> 107 $content = str_replace('<br>', '<br />',$content); 108 $content = str_replace('<hr>', '<hr />',$content); 102 103 // Just a little XHTML help 104 $content = str_replace('<br>', '<br />', $content); 105 $content = str_replace('<hr>', '<hr />', $content); 109 106 110 107 return $content; … … 210 207 } 211 208 212 #WP fix for the bug with HTML comments209 // WP fix for the bug with HTML comments 213 210 $newtext = str_replace("< !--","<!--",$newtext); 214 211 $newtext = str_replace("< !--","< !--",$newtext); 215 212 216 213 return $newtext; 217 }218 219 function autobrize($content) {220 $content = preg_replace("/<br>\n/", "\n", $content);221 $content = preg_replace("/<br \/>\n/", "\n", $content);222 $content = preg_replace("/(\015\012)|(\015)|(\012)/", "<br />\n", $content);223 return $content;224 }225 226 function unautobrize($content) {227 $content = preg_replace("/<br>\n/", "\n", $content); //for PHP versions before 4.0.5228 $content = preg_replace("/<br \/>\n/", "\n", $content);229 return $content;230 214 } 231 215 … … 301 285 } 302 286 303 function convert_bbcode($content) { // depreciated304 return $content;305 }306 307 function convert_bbcode_email($content) {308 global $use_bbcode;309 $bbcode_email["in"] = array(310 '#\[email](.+?)\[/email]#eis',311 '#\[email=(.+?)](.+?)\[/email]#eis'312 );313 $bbcode_email["out"] = array(314 "'<a href=\"mailto:'.antispambot('\\1').'\">'.antispambot('\\1').'</a>'", // E-mail315 "'<a href=\"mailto:'.antispambot('\\1').'\">\\2</a>'"316 );317 318 $content = preg_replace($bbcode_email["in"], $bbcode_email["out"], $content);319 return $content;320 }321 322 function convert_gmcode($content) { // depreciated323 return $content;324 }325 326 287 function convert_smilies($text) { 327 288 global $wp_smiliessearch, $wp_smiliesreplace; -
trunk/wp-includes/functions.php
r1109 r1121 863 863 if(($lon != null) && ($lat != null) ) { 864 864 echo "<meta name=\"ICBM\" content=\"".$lat.", ".$lon."\" />\n"; 865 echo "<meta name=\"DC.title\" content=\"".convert_chars(strip_tags(get_bloginfo("name")) ,"unicode")." - ".$title."\" />\n";865 echo "<meta name=\"DC.title\" content=\"".convert_chars(strip_tags(get_bloginfo("name")))." - ".$title."\" />\n"; 866 866 echo "<meta name=\"geo.position\" content=\"".$lat.";".$lon."\" />\n"; 867 867 return; … … 871 871 // send the default here 872 872 echo "<meta name=\"ICBM\" content=\"". get_settings('default_geourl_lat') .", ". get_settings('default_geourl_lon') ."\" />\n"; 873 echo "<meta name=\"DC.title\" content=\"".convert_chars(strip_tags(get_bloginfo("name")) ,"unicode")."\" />\n";873 echo "<meta name=\"DC.title\" content=\"".convert_chars(strip_tags(get_bloginfo("name")))."\" />\n"; 874 874 echo "<meta name=\"geo.position\" content=\"". get_settings('default_geourl_lat') .";". get_settings('default_geourl_lon') ."\" />\n"; 875 875 } … … 1059 1059 function start_wp() { 1060 1060 global $post, $id, $postdata, $authordata, $day, $preview, $page, $pages, $multipage, $more, $numpages; 1061 global $preview_userid,$preview_date,$preview_content,$preview_title,$preview_category,$preview_notify,$preview_make_clickable,$preview_autobr;1062 1061 global $pagenow; 1063 1062 if (!$preview) { -
trunk/wp-includes/template-functions-general.php
r1108 r1121 5 5 function bloginfo($show='') { 6 6 $info = get_bloginfo($show); 7 $info = convert_bbcode($info);8 $info = convert_gmcode($info);9 $info = convert_smilies($info);10 7 $info = apply_filters('bloginfo', $info); 11 echo convert_chars($info , 'html');8 echo convert_chars($info); 12 9 } 13 10 14 11 function bloginfo_rss($show='') { 15 12 $info = strip_tags(get_bloginfo($show)); 16 echo convert_chars($info , 'unicode');13 echo convert_chars($info); 17 14 } 18 15 19 16 function bloginfo_unicode($show='') { 20 17 $info = get_bloginfo($show); 21 echo convert_chars($info , 'unicode');18 echo convert_chars($info); 22 19 } 23 20 -
trunk/wp-includes/vars.php
r1108 r1121 3 3 /* This file sets various arrays and variables for use in WordPress */ 4 4 require(ABSPATH . 'wp-includes/version.php'); 5 6 # Translation of HTML entities and special characters7 $wp_htmltrans = array_flip(get_html_translation_table(HTML_ENTITIES));8 $wp_htmltrans['<'] = '<'; # preserve HTML9 $wp_htmltrans['>'] = '>'; # preserve HTML10 $wp_htmltransbis = array(11 '' => '–',12 '' => '—',13 '' => '‘',14 '' => '’',15 '' => '“',16 '' => '”',17 '' => '•',18 '' => '€',19 '<' => '<', # preserve fake HTML20 '>' => '>', # preserve fake HTML21 '&' => '&', # preserve fake HTML22 '&sp;' => ' ', '!' => '!', '"' => '"', '#' => '#', '$' => '$', '%' => '%', ''' => ''', '(' => '(', ')' => ')',23 '*' => '*', '+' => '+', ',' => ',', '‐' => '-', '−' => '-', '.' => '.', '/' => '/', ':' => ':', ';' => ';', '<' => '<',24 '=' => '=', '>' => '>', '?' => '?', '@' => '@', '[' => '[', '\' => '\', ']' => ']', 'ˆ' => '^', '_' => '_', '―' => '_',25 '`' => '`', '{' => '{', '|' => '|', '}' => '}', '˜' => '~', '‚' => '‚', '„' => '„',26 '&ldots;' => '…', 'Š' => 'Š', '‹' => '‹', 'Œ' => 'Œ', '‘' => '‘', '’' => '‘', '’' => '’',27 '“' => '“', '”' => '“', '”' => '”', '•' => '•', '–' => '–', '&endash;' => '–', '—' => '—', '&emdash;' => '—', '˜' => '˜', '™' => '™',28 'š' => 'š', '›' => '›', 'œ' => 'œ', 'Ÿ' => 'Ÿ', ' ' => ' ', '¡' => '¡', '¢' => '¢', '£' => '£', '¤' => '¤', '¥' => '¥',29 '¦' => '¦', '&brkbar;' => '¦', '§' => '§', '¨' => '¨', '¨' => '¨', '©' => '©', 'ª' => 'ª', '«' => '«', '¬' => '¬', '­' => '­',30 '®' => '®', '¯' => '¯', '&hibar;' => '¯', '°' => '°', '±' => '±', '²' => '²', '³' => '³', '´' => '´', 'µ' => 'µ', '¶' => '¶',31 '·' => '·', '¸' => '¸', '¹' => '¹', 'º' => 'º', '»' => '»', '¼' => '¼', '½' => '½', '½' => '½', '¾' => '¾', '¿' => '¿',32 'À' => 'À', 'Á' => 'Á', 'Â' => 'Â', 'Ã' => 'Ã', 'Ä' => 'Ä', 'Å' => 'Å', 'Æ' => 'Æ', 'Ç' => 'Ç', 'È' => 'È', 'É' => 'É',33 'Ê' => 'Ê', 'Ë' => 'Ë', 'Ì' => 'Ì', 'Í' => 'Í', 'Î' => 'Î', 'Ï' => 'Ï', 'Ð' => 'Ð', 'Ñ' => 'Ñ', 'Ò' => 'Ò', 'Ó' => 'Ó',34 'Ô' => 'Ô', 'Õ' => 'Õ', 'Ö' => 'Ö', '×' => '×', 'Ø' => 'Ø', 'Ù' => 'Ù', 'Ú' => 'Ú', 'Û' => 'Û', 'Ü' => 'Ü', 'Ý' => 'Ý',35 'Þ' => 'Þ', 'ß' => 'ß', 'à' => 'à', 'á' => 'á', 'â' => 'â', 'ã' => 'ã', 'ä' => 'ä', 'å' => 'å', 'æ' => 'æ', 'ç' => 'ç',36 'è' => 'è', 'é' => 'é', 'ê' => 'ê', 'ë' => 'ë', 'ì' => 'ì', 'í' => 'í', 'î' => 'î', 'ï' => 'ï', 'ð' => 'ð', 'ñ' => 'ñ',37 'ò' => 'ò', 'ó' => 'ó', 'ô' => 'ô', 'õ' => 'õ', 'ö' => 'ö', '÷' => '÷', 'ø' => 'ø', 'ù' => 'ù', 'ú' => 'ú', 'û' => 'û',38 'ü' => 'ü', 'ý' => 'ý', 'þ' => 'þ', 'ÿ' => 'ÿ', 'Œ' => 'Œ', 'œ' => 'œ', 'Š' => 'Š', 'š' => 'š', 'Ÿ' => 'Ÿ', 'ƒ' => 'ƒ',39 'ˆ' => 'ˆ', '˜' => '˜', 'Α' => 'Α', 'Β' => 'Β', 'Γ' => 'Γ', 'Δ' => 'Δ', 'Ε' => 'Ε', 'Ζ' => 'Ζ', 'Η' => 'Η', 'Θ' => 'Θ',40 'Ι' => 'Ι', 'Κ' => 'Κ', 'Λ' => 'Λ', 'Μ' => 'Μ', 'Ν' => 'Ν', 'Ξ' => 'Ξ', 'Ο' => 'Ο', 'Π' => 'Π', 'Ρ' => 'Ρ', 'Σ' => 'Σ',41 'Τ' => 'Τ', 'Υ' => 'Υ', 'Φ' => 'Φ', 'Χ' => 'Χ', 'Ψ' => 'Ψ', 'Ω' => 'Ω', 'α' => 'α', 'β' => 'β', 'γ' => 'γ', 'δ' => 'δ',42 'ε' => 'ε', 'ζ' => 'ζ', 'η' => 'η', 'θ' => 'θ', 'ι' => 'ι', 'κ' => 'κ', 'λ' => 'λ', 'μ' => 'μ', 'ν' => 'ν', 'ξ' => 'ξ',43 'ο' => 'ο', 'π' => 'π', 'ρ' => 'ρ', 'ς' => 'ς', 'σ' => 'σ', 'τ' => 'τ', 'υ' => 'υ', 'φ' => 'φ', 'χ' => 'χ', 'ψ' => 'ψ',44 'ω' => 'ω', 'ϑ' => 'ϑ', 'ϒ' => 'ϒ', 'ϖ' => 'ϖ', ' ' => ' ', ' ' => ' ', ' ' => ' ', '‌' => '‌', '‍' => '‍', '‎' => '‎',45 '‏' => '‏', '–' => '–', '—' => '—', '‘' => '‘', '’' => '’', '‚' => '‚', '“' => '“', '”' => '”', '„' => '„', '†' => '†',46 '‡' => '‡', '•' => '•', '…' => '…', '‰' => '‰', '′' => '′', '″' => '″', '‹' => '‹', '›' => '›', '‾' => '‾', '⁄' => '⁄',47 '€' => '€', 'ℑ' => 'ℑ', '℘' => '℘', 'ℜ' => 'ℜ', '™' => '™', 'ℵ' => 'ℵ', '←' => '←', '↑' => '↑', '→' => '→', '↓' => '↓',48 '↔' => '↔', '↵' => '↵', '⇐' => '⇐', '⇑' => '⇑', '⇒' => '⇒', '⇓' => '⇓', '⇔' => '⇔', '∀' => '∀', '∂' => '∂', '∃' => '∃',49 '∅' => '∅', '∇' => '∇', '∈' => '∈', '∉' => '∉', '∋' => '∋', '∏' => '∏', '∑' => '∑', '−' => '−', '∗' => '∗', '√' => '√',50 '∝' => '∝', '∞' => '∞', '∠' => '∠', '∧' => '∧', '∨' => '∨', '∩' => '∩', '∪' => '∪', '∫' => '∫', '∴' => '∴', '∼' => '∼',51 '≅' => '≅', '≈' => '≈', '≠' => '≠', '≡' => '≡', '≤' => '≤', '≥' => '≥', '⊂' => '⊂', '⊃' => '⊃', '⊄' => '⊄', '⊆' => '⊆',52 '⊇' => '⊇', '⊕' => '⊕', '⊗' => '⊗', '⊥' => '⊥', '⋅' => '⋅', '⌈' => '⌈', '⌉' => '⌉', '⌊' => '⌊', '⌋' => '⌋', '⟨' => '〈',53 '⟩' => '〉', '◊' => '◊', '♠' => '♠', '♣' => '♣', '♥' => '♥', '♦' => '♦'54 );55 $wp_htmltrans = array_merge($wp_htmltrans,$wp_htmltransbis);56 5 57 6 # Translation of invalid Unicode references range to valid range -
trunk/wp-links-opml.php
r1108 r1121 25 25 <head> 26 26 <title>Links for <?php echo get_bloginfo('name').$cat_name ?></title> 27 <ownerName><?php echo antispambot(get_bloginfo('admin_email')) ?></ownerName>28 <ownerEmail><?php echo antispambot(get_bloginfo('admin_email')) ?></ownerEmail>29 27 <dateCreated><?php echo gmdate("D, d M Y H:i:s"); ?> GMT</dateCreated> 30 28 </head> -
trunk/wp-rdf.php
r1045 r1121 26 26 <dc:language><?php echo get_settings('rss_language'); ?></dc:language> 27 27 <dc:date><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastpostmodified('GMT')); ?></dc:date> 28 <dc:creator><?php echo antispambot(get_settings('admin_email')) ?></dc:creator>29 28 <admin:generatorAgent rdf:resource="http://wordpress.org/?v=<?php echo $wp_version ?>"/> 30 <admin:errorReportsTo rdf:resource="mailto:<?php echo antispambot(get_settings('admin_email')) ?>"/>31 29 <sy:updatePeriod>hourly</sy:updatePeriod> 32 30 <sy:updateFrequency>1</sy:updateFrequency> -
trunk/wp-rss.php
r1046 r1121 19 19 <lastBuildDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT')); ?></lastBuildDate> 20 20 <docs>http://backend.userland.com/rss092</docs> 21 <managingEditor><?php echo antispambot(get_settings('admin_email')) ?></managingEditor>22 <webMaster><?php echo antispambot(get_settings('admin_email')) ?></webMaster>23 21 <language><?php echo get_settings('rss_language'); ?></language> 24 22
Note: See TracChangeset
for help on using the changeset viewer.