mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-03 15:08:10 +01:00
Removing some old functions. Cleaning up remaining places where we exposed emails. Consolidated ampersand fixing. Fixed pasting from Word.
git-svn-id: http://svn.automattic.com/wordpress/trunk@1121 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
5c5423dbb6
commit
9439a575f6
@ -1,8 +1,9 @@
|
||||
<?php
|
||||
|
||||
function wptexturize($text) {
|
||||
$output = "";
|
||||
$textarr = preg_split("/(<.*>)/Us", $text, -1, PREG_SPLIT_DELIM_CAPTURE); // capture the tags as well as in between
|
||||
$output = '';
|
||||
// Capture tags and everything inside them
|
||||
$textarr = preg_split("/(<.*>)/Us", $text, -1, PREG_SPLIT_DELIM_CAPTURE);
|
||||
$stop = count($textarr); $next = true; // loop stuff
|
||||
for ($i = 0; $i < $stop; $i++) {
|
||||
$curl = $textarr[$i];
|
||||
@ -30,7 +31,6 @@ function wptexturize($text) {
|
||||
$curl = preg_replace("/\(tm\)/i", '™', $curl);
|
||||
$curl = preg_replace("/\(c\)/i", '©', $curl);
|
||||
$curl = preg_replace("/\(r\)/i", '®', $curl);
|
||||
$curl = preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', $curl);
|
||||
$curl = str_replace("''", '”', $curl);
|
||||
|
||||
$curl = preg_replace('/(d+)x(\d+)/', "$1×$2", $curl);
|
||||
@ -55,9 +55,10 @@ function clean_pre($text) {
|
||||
function wpautop($pee, $br = 1) {
|
||||
$pee = $pee . "\n"; // just to make things a little easier, pad the end
|
||||
$pee = preg_replace('|<br />\s*<br />|', "\n\n", $pee);
|
||||
$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
|
||||
$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
|
||||
$pee = preg_replace("/(\r\n|\r)/", "\n", $pee); // cross-platform newlines
|
||||
// Space things out a little
|
||||
$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);
|
||||
$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);
|
||||
$pee = str_replace(array("\r\n", "\r"), "\n", $pee); // cross-platform newlines
|
||||
$pee = preg_replace("/\n\n+/", "\n\n", $pee); // take care of duplicates
|
||||
$pee = preg_replace('/\n?(.+?)(?:\n\s*\n|\z)/s', "\t<p>$1</p>\n", $pee); // make paragraphs, including one at the end
|
||||
$pee = preg_replace('|<p>\s*?</p>|', '', $pee); // under certain strange conditions it could create a P of entirely whitespace
|
||||
@ -71,7 +72,6 @@ function wpautop($pee, $br = 1) {
|
||||
$pee = preg_replace('!(</?(?:table|thead|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|p|h[1-6])[^>]*>)\s*<br />!', "$1", $pee);
|
||||
$pee = preg_replace('!<br />(\s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)!', '$1', $pee);
|
||||
$pee = preg_replace('!(<pre.*?>)(.*?)</pre>!ise', " stripslashes('$1') . clean_pre('$2') . '</pre>' ", $pee);
|
||||
$pee = preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', $pee);
|
||||
|
||||
return $pee;
|
||||
}
|
||||
@ -87,25 +87,22 @@ function sanitize_title($title) {
|
||||
return $title;
|
||||
}
|
||||
|
||||
function convert_chars($content, $flag='obsolete attribute left there for backwards compatibility') {
|
||||
// html/unicode entities output
|
||||
global $wp_htmltrans, $wp_htmltranswinuni;
|
||||
function convert_chars($content, $flag = 'obsolete') {
|
||||
global $wp_htmltranswinuni;
|
||||
|
||||
// removes metadata tags
|
||||
// Remove metadata tags
|
||||
$content = preg_replace('/<title>(.+?)<\/title>/','',$content);
|
||||
$content = preg_replace('/<category>(.+?)<\/category>/','',$content);
|
||||
// converts lone & characters into & (a.k.a. &)
|
||||
$content = preg_replace('/&[^#](?![a-z]*;)/ie', '"&".substr("\0",1)', $content);
|
||||
$content = strtr($content, $wp_htmltranswinuni);
|
||||
if (get_settings('use_htmltrans')) {
|
||||
// converts HTML-entities to their display values in order to convert them again later
|
||||
$content = preg_replace('/['.chr(127).'-'.chr(255).']/e', '"&#".ord(\'\0\').";"', $content );
|
||||
$content = strtr($content, $wp_htmltrans);
|
||||
}
|
||||
|
||||
// you can delete these 2 lines if you don't like <br /> and <hr />
|
||||
$content = str_replace('<br>', '<br />',$content);
|
||||
$content = str_replace('<hr>', '<hr />',$content);
|
||||
// Converts lone & characters into & (a.k.a. &)
|
||||
$content = preg_replace('/&([^#])(?![a-z]{1,8};)/i', '&$1', $content);
|
||||
|
||||
// Fix Word pasting
|
||||
$content = strtr($content, $wp_htmltranswinuni);
|
||||
|
||||
// Just a little XHTML help
|
||||
$content = str_replace('<br>', '<br />', $content);
|
||||
$content = str_replace('<hr>', '<hr />', $content);
|
||||
|
||||
return $content;
|
||||
}
|
||||
@ -209,26 +206,13 @@ function balanceTags($text, $is_comment = 0) {
|
||||
$newtext = $newtext . '</' . $x . '>'; // Add remaining tags to close
|
||||
}
|
||||
|
||||
# WP fix for the bug with HTML comments
|
||||
// WP fix for the bug with HTML comments
|
||||
$newtext = str_replace("< !--","<!--",$newtext);
|
||||
$newtext = str_replace("< !--","< !--",$newtext);
|
||||
|
||||
return $newtext;
|
||||
}
|
||||
|
||||
function autobrize($content) {
|
||||
$content = preg_replace("/<br>\n/", "\n", $content);
|
||||
$content = preg_replace("/<br \/>\n/", "\n", $content);
|
||||
$content = preg_replace("/(\015\012)|(\015)|(\012)/", "<br />\n", $content);
|
||||
return $content;
|
||||
}
|
||||
|
||||
function unautobrize($content) {
|
||||
$content = preg_replace("/<br>\n/", "\n", $content); //for PHP versions before 4.0.5
|
||||
$content = preg_replace("/<br \/>\n/", "\n", $content);
|
||||
return $content;
|
||||
}
|
||||
|
||||
|
||||
function format_to_edit($content) {
|
||||
$content = stripslashes($content);
|
||||
@ -300,29 +284,6 @@ function make_clickable($text) { // original function: phpBB, extended here for
|
||||
return $ret;
|
||||
}
|
||||
|
||||
function convert_bbcode($content) { // depreciated
|
||||
return $content;
|
||||
}
|
||||
|
||||
function convert_bbcode_email($content) {
|
||||
global $use_bbcode;
|
||||
$bbcode_email["in"] = array(
|
||||
'#\[email](.+?)\[/email]#eis',
|
||||
'#\[email=(.+?)](.+?)\[/email]#eis'
|
||||
);
|
||||
$bbcode_email["out"] = array(
|
||||
"'<a href=\"mailto:'.antispambot('\\1').'\">'.antispambot('\\1').'</a>'", // E-mail
|
||||
"'<a href=\"mailto:'.antispambot('\\1').'\">\\2</a>'"
|
||||
);
|
||||
|
||||
$content = preg_replace($bbcode_email["in"], $bbcode_email["out"], $content);
|
||||
return $content;
|
||||
}
|
||||
|
||||
function convert_gmcode($content) { // depreciated
|
||||
return $content;
|
||||
}
|
||||
|
||||
function convert_smilies($text) {
|
||||
global $wp_smiliessearch, $wp_smiliesreplace;
|
||||
$output = '';
|
||||
|
@ -862,7 +862,7 @@ function doGeoUrlHeader($posts) {
|
||||
$title = $row->post_title;
|
||||
if(($lon != null) && ($lat != null) ) {
|
||||
echo "<meta name=\"ICBM\" content=\"".$lat.", ".$lon."\" />\n";
|
||||
echo "<meta name=\"DC.title\" content=\"".convert_chars(strip_tags(get_bloginfo("name")),"unicode")." - ".$title."\" />\n";
|
||||
echo "<meta name=\"DC.title\" content=\"".convert_chars(strip_tags(get_bloginfo("name")))." - ".$title."\" />\n";
|
||||
echo "<meta name=\"geo.position\" content=\"".$lat.";".$lon."\" />\n";
|
||||
return;
|
||||
}
|
||||
@ -870,7 +870,7 @@ function doGeoUrlHeader($posts) {
|
||||
if(get_settings('use_default_geourl')) {
|
||||
// send the default here
|
||||
echo "<meta name=\"ICBM\" content=\"". get_settings('default_geourl_lat') .", ". get_settings('default_geourl_lon') ."\" />\n";
|
||||
echo "<meta name=\"DC.title\" content=\"".convert_chars(strip_tags(get_bloginfo("name")),"unicode")."\" />\n";
|
||||
echo "<meta name=\"DC.title\" content=\"".convert_chars(strip_tags(get_bloginfo("name")))."\" />\n";
|
||||
echo "<meta name=\"geo.position\" content=\"". get_settings('default_geourl_lat') .";". get_settings('default_geourl_lon') ."\" />\n";
|
||||
}
|
||||
}
|
||||
@ -1058,7 +1058,6 @@ function wp_notify_moderator($comment_id) {
|
||||
|
||||
function start_wp() {
|
||||
global $post, $id, $postdata, $authordata, $day, $preview, $page, $pages, $multipage, $more, $numpages;
|
||||
global $preview_userid,$preview_date,$preview_content,$preview_title,$preview_category,$preview_notify,$preview_make_clickable,$preview_autobr;
|
||||
global $pagenow;
|
||||
if (!$preview) {
|
||||
$id = $post->ID;
|
||||
|
@ -4,21 +4,18 @@
|
||||
|
||||
function bloginfo($show='') {
|
||||
$info = get_bloginfo($show);
|
||||
$info = convert_bbcode($info);
|
||||
$info = convert_gmcode($info);
|
||||
$info = convert_smilies($info);
|
||||
$info = apply_filters('bloginfo', $info);
|
||||
echo convert_chars($info, 'html');
|
||||
echo convert_chars($info);
|
||||
}
|
||||
|
||||
function bloginfo_rss($show='') {
|
||||
$info = strip_tags(get_bloginfo($show));
|
||||
echo convert_chars($info, 'unicode');
|
||||
echo convert_chars($info);
|
||||
}
|
||||
|
||||
function bloginfo_unicode($show='') {
|
||||
$info = get_bloginfo($show);
|
||||
echo convert_chars($info, 'unicode');
|
||||
echo convert_chars($info);
|
||||
}
|
||||
|
||||
function get_bloginfo($show='') {
|
||||
|
@ -3,57 +3,6 @@
|
||||
/* This file sets various arrays and variables for use in WordPress */
|
||||
require(ABSPATH . 'wp-includes/version.php');
|
||||
|
||||
# Translation of HTML entities and special characters
|
||||
$wp_htmltrans = array_flip(get_html_translation_table(HTML_ENTITIES));
|
||||
$wp_htmltrans['<'] = '<'; # preserve HTML
|
||||
$wp_htmltrans['>'] = '>'; # preserve HTML
|
||||
$wp_htmltransbis = array(
|
||||
'–' => '–',
|
||||
'—' => '—',
|
||||
'‘' => '‘',
|
||||
'’' => '’',
|
||||
'“' => '“',
|
||||
'”' => '”',
|
||||
'•' => '•',
|
||||
'€' => '€',
|
||||
'<' => '<', # preserve fake HTML
|
||||
'>' => '>', # preserve fake HTML
|
||||
'&' => '&', # preserve fake HTML
|
||||
'&sp;' => ' ', '!' => '!', '"' => '"', '#' => '#', '$' => '$', '%' => '%', ''' => ''', '(' => '(', ')' => ')',
|
||||
'*' => '*', '+' => '+', ',' => ',', '‐' => '-', '−' => '-', '.' => '.', '/' => '/', ':' => ':', ';' => ';', '<' => '<',
|
||||
'=' => '=', '>' => '>', '?' => '?', '@' => '@', '[' => '[', '\' => '\', ']' => ']', 'ˆ' => '^', '_' => '_', '―' => '_',
|
||||
'`' => '`', '{' => '{', '|' => '|', '}' => '}', '˜' => '~', '‚' => '‚', '„' => '„',
|
||||
'&ldots;' => '…', 'Š' => 'Š', '‹' => '‹', 'Œ' => 'Œ', '‘' => '‘', '’' => '‘', '’' => '’',
|
||||
'“' => '“', '”' => '“', '”' => '”', '•' => '•', '–' => '–', '&endash;' => '–', '—' => '—', '&emdash;' => '—', '˜' => '˜', '™' => '™',
|
||||
'š' => 'š', '›' => '›', 'œ' => 'œ', 'Ÿ' => 'Ÿ', ' ' => ' ', '¡' => '¡', '¢' => '¢', '£' => '£', '¤' => '¤', '¥' => '¥',
|
||||
'¦' => '¦', '&brkbar;' => '¦', '§' => '§', '¨' => '¨', '¨' => '¨', '©' => '©', 'ª' => 'ª', '«' => '«', '¬' => '¬', '­' => '­',
|
||||
'®' => '®', '¯' => '¯', '&hibar;' => '¯', '°' => '°', '±' => '±', '²' => '²', '³' => '³', '´' => '´', 'µ' => 'µ', '¶' => '¶',
|
||||
'·' => '·', '¸' => '¸', '¹' => '¹', 'º' => 'º', '»' => '»', '¼' => '¼', '½' => '½', '½' => '½', '¾' => '¾', '¿' => '¿',
|
||||
'À' => 'À', 'Á' => 'Á', 'Â' => 'Â', 'Ã' => 'Ã', 'Ä' => 'Ä', 'Å' => 'Å', 'Æ' => 'Æ', 'Ç' => 'Ç', 'È' => 'È', 'É' => 'É',
|
||||
'Ê' => 'Ê', 'Ë' => 'Ë', 'Ì' => 'Ì', 'Í' => 'Í', 'Î' => 'Î', 'Ï' => 'Ï', 'Ð' => 'Ð', 'Ñ' => 'Ñ', 'Ò' => 'Ò', 'Ó' => 'Ó',
|
||||
'Ô' => 'Ô', 'Õ' => 'Õ', 'Ö' => 'Ö', '×' => '×', 'Ø' => 'Ø', 'Ù' => 'Ù', 'Ú' => 'Ú', 'Û' => 'Û', 'Ü' => 'Ü', 'Ý' => 'Ý',
|
||||
'Þ' => 'Þ', 'ß' => 'ß', 'à' => 'à', 'á' => 'á', 'â' => 'â', 'ã' => 'ã', 'ä' => 'ä', 'å' => 'å', 'æ' => 'æ', 'ç' => 'ç',
|
||||
'è' => 'è', 'é' => 'é', 'ê' => 'ê', 'ë' => 'ë', 'ì' => 'ì', 'í' => 'í', 'î' => 'î', 'ï' => 'ï', 'ð' => 'ð', 'ñ' => 'ñ',
|
||||
'ò' => 'ò', 'ó' => 'ó', 'ô' => 'ô', 'õ' => 'õ', 'ö' => 'ö', '÷' => '÷', 'ø' => 'ø', 'ù' => 'ù', 'ú' => 'ú', 'û' => 'û',
|
||||
'ü' => 'ü', 'ý' => 'ý', 'þ' => 'þ', 'ÿ' => 'ÿ', 'Œ' => 'Œ', 'œ' => 'œ', 'Š' => 'Š', 'š' => 'š', 'Ÿ' => 'Ÿ', 'ƒ' => 'ƒ',
|
||||
'ˆ' => 'ˆ', '˜' => '˜', 'Α' => 'Α', 'Β' => 'Β', 'Γ' => 'Γ', 'Δ' => 'Δ', 'Ε' => 'Ε', 'Ζ' => 'Ζ', 'Η' => 'Η', 'Θ' => 'Θ',
|
||||
'Ι' => 'Ι', 'Κ' => 'Κ', 'Λ' => 'Λ', 'Μ' => 'Μ', 'Ν' => 'Ν', 'Ξ' => 'Ξ', 'Ο' => 'Ο', 'Π' => 'Π', 'Ρ' => 'Ρ', 'Σ' => 'Σ',
|
||||
'Τ' => 'Τ', 'Υ' => 'Υ', 'Φ' => 'Φ', 'Χ' => 'Χ', 'Ψ' => 'Ψ', 'Ω' => 'Ω', 'α' => 'α', 'β' => 'β', 'γ' => 'γ', 'δ' => 'δ',
|
||||
'ε' => 'ε', 'ζ' => 'ζ', 'η' => 'η', 'θ' => 'θ', 'ι' => 'ι', 'κ' => 'κ', 'λ' => 'λ', 'μ' => 'μ', 'ν' => 'ν', 'ξ' => 'ξ',
|
||||
'ο' => 'ο', 'π' => 'π', 'ρ' => 'ρ', 'ς' => 'ς', 'σ' => 'σ', 'τ' => 'τ', 'υ' => 'υ', 'φ' => 'φ', 'χ' => 'χ', 'ψ' => 'ψ',
|
||||
'ω' => 'ω', 'ϑ' => 'ϑ', 'ϒ' => 'ϒ', 'ϖ' => 'ϖ', ' ' => ' ', ' ' => ' ', ' ' => ' ', '‌' => '‌', '‍' => '‍', '‎' => '‎',
|
||||
'‏' => '‏', '–' => '–', '—' => '—', '‘' => '‘', '’' => '’', '‚' => '‚', '“' => '“', '”' => '”', '„' => '„', '†' => '†',
|
||||
'‡' => '‡', '•' => '•', '…' => '…', '‰' => '‰', '′' => '′', '″' => '″', '‹' => '‹', '›' => '›', '‾' => '‾', '⁄' => '⁄',
|
||||
'€' => '€', 'ℑ' => 'ℑ', '℘' => '℘', 'ℜ' => 'ℜ', '™' => '™', 'ℵ' => 'ℵ', '←' => '←', '↑' => '↑', '→' => '→', '↓' => '↓',
|
||||
'↔' => '↔', '↵' => '↵', '⇐' => '⇐', '⇑' => '⇑', '⇒' => '⇒', '⇓' => '⇓', '⇔' => '⇔', '∀' => '∀', '∂' => '∂', '∃' => '∃',
|
||||
'∅' => '∅', '∇' => '∇', '∈' => '∈', '∉' => '∉', '∋' => '∋', '∏' => '∏', '∑' => '∑', '−' => '−', '∗' => '∗', '√' => '√',
|
||||
'∝' => '∝', '∞' => '∞', '∠' => '∠', '∧' => '∧', '∨' => '∨', '∩' => '∩', '∪' => '∪', '∫' => '∫', '∴' => '∴', '∼' => '∼',
|
||||
'≅' => '≅', '≈' => '≈', '≠' => '≠', '≡' => '≡', '≤' => '≤', '≥' => '≥', '⊂' => '⊂', '⊃' => '⊃', '⊄' => '⊄', '⊆' => '⊆',
|
||||
'⊇' => '⊇', '⊕' => '⊕', '⊗' => '⊗', '⊥' => '⊥', '⋅' => '⋅', '⌈' => '⌈', '⌉' => '⌉', '⌊' => '⌊', '⌋' => '⌋', '⟨' => '〈',
|
||||
'⟩' => '〉', '◊' => '◊', '♠' => '♠', '♣' => '♣', '♥' => '♥', '♦' => '♦'
|
||||
);
|
||||
$wp_htmltrans = array_merge($wp_htmltrans,$wp_htmltransbis);
|
||||
|
||||
# Translation of invalid Unicode references range to valid range
|
||||
$wp_htmltranswinuni = array(
|
||||
'€' => '€', // the Euro sign
|
||||
|
@ -24,8 +24,6 @@ if ((empty($link_cat)) || ($link_cat == 'all') || ($link_cat == '0')) {
|
||||
<opml version="1.0">
|
||||
<head>
|
||||
<title>Links for <?php echo get_bloginfo('name').$cat_name ?></title>
|
||||
<ownerName><?php echo antispambot(get_bloginfo('admin_email')) ?></ownerName>
|
||||
<ownerEmail><?php echo antispambot(get_bloginfo('admin_email')) ?></ownerEmail>
|
||||
<dateCreated><?php echo gmdate("D, d M Y H:i:s"); ?> GMT</dateCreated>
|
||||
</head>
|
||||
<body>
|
||||
|
@ -25,9 +25,7 @@ add_filter('the_content', 'trim');
|
||||
<description><?php bloginfo_rss('description') ?></description>
|
||||
<dc:language><?php echo get_settings('rss_language'); ?></dc:language>
|
||||
<dc:date><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastpostmodified('GMT')); ?></dc:date>
|
||||
<dc:creator><?php echo antispambot(get_settings('admin_email')) ?></dc:creator>
|
||||
<admin:generatorAgent rdf:resource="http://wordpress.org/?v=<?php echo $wp_version ?>"/>
|
||||
<admin:errorReportsTo rdf:resource="mailto:<?php echo antispambot(get_settings('admin_email')) ?>"/>
|
||||
<sy:updatePeriod>hourly</sy:updatePeriod>
|
||||
<sy:updateFrequency>1</sy:updateFrequency>
|
||||
<sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
|
||||
|
@ -18,8 +18,6 @@ header('Content-type: text/xml', true);
|
||||
<description><?php bloginfo_rss("description") ?></description>
|
||||
<lastBuildDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT')); ?></lastBuildDate>
|
||||
<docs>http://backend.userland.com/rss092</docs>
|
||||
<managingEditor><?php echo antispambot(get_settings('admin_email')) ?></managingEditor>
|
||||
<webMaster><?php echo antispambot(get_settings('admin_email')) ?></webMaster>
|
||||
<language><?php echo get_settings('rss_language'); ?></language>
|
||||
|
||||
<?php $items_count = 0; if ($posts) { foreach ($posts as $post) { start_wp(); ?>
|
||||
|
Loading…
Reference in New Issue
Block a user