mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-03 15:08:10 +01:00
Clean up global ideas from michel_v
git-svn-id: http://svn.automattic.com/wordpress/trunk@1994 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
d464b81ae6
commit
f9b77bb837
@ -20,34 +20,20 @@ window.close()
|
|||||||
</html>
|
</html>
|
||||||
<?php
|
<?php
|
||||||
} else {
|
} else {
|
||||||
$popuptitle = wp_specialchars(stripslashes($popuptitle));
|
$popuptitle = wp_specialchars(stripslashes($popuptitle));
|
||||||
$text = wp_specialchars(stripslashes(urldecode($text)));
|
$text = wp_specialchars(stripslashes(urldecode($text)));
|
||||||
|
|
||||||
/* big funky fixes for browsers' javascript bugs */
|
$popuptitle = funky_javascript_fix($popuptitle);
|
||||||
|
$text = funky_javascript_fix($text);
|
||||||
if (($is_macIE) && (!isset($IEMac_bookmarklet_fix))) {
|
|
||||||
$popuptitle = preg_replace('/'.$wp_macIE_correction["in"].'/','/'.$wp_macIE_correction["out"].'/',$popuptitle);
|
$post_title = wp_specialchars($_REQUEST['post_title']);
|
||||||
$text = preg_replace('/'.$wp_macIE_correction["in"].'/','/'.$wp_macIE_correction["out"].'/',$text);
|
if (!empty($post_title)) {
|
||||||
}
|
$post_title = stripslashes($post_title);
|
||||||
|
} else {
|
||||||
if (($is_winIE) && (!isset($IEWin_bookmarklet_fix))) {
|
$post_title = $popuptitle;
|
||||||
$popuptitle = preg_replace("/\%u([0-9A-F]{4,4})/e", "'&#'.base_convert('\\1',16,10).';'", $popuptitle);
|
}
|
||||||
$text = preg_replace("/\%u([0-9A-F]{4,4})/e", "'&#'.base_convert('\\1',16,10).';'", $text);
|
|
||||||
}
|
$edited_post_title = wp_specialchars($post_title);
|
||||||
|
|
||||||
if (($is_gecko) && (!isset($Gecko_bookmarklet_fix))) {
|
|
||||||
$popuptitle = preg_replace('/'.$wp_gecko_correction["in"].'/','/'.$wp_gecko_correction["out"].'/',$popuptitle);
|
|
||||||
$text = preg_replace('/'.$wp_gecko_correction["in"].'/','/'.$wp_gecko_correction["out"].'/',$text);
|
|
||||||
}
|
|
||||||
|
|
||||||
$post_title = wp_specialchars($_REQUEST['post_title']);
|
|
||||||
if (!empty($post_title)) {
|
|
||||||
$post_title = stripslashes($post_title);
|
|
||||||
} else {
|
|
||||||
$post_title = $popuptitle;
|
|
||||||
}
|
|
||||||
|
|
||||||
$edited_post_title = wp_specialchars($post_title);
|
|
||||||
|
|
||||||
// $post_pingback needs to be set in any file that includes edit-form.php
|
// $post_pingback needs to be set in any file that includes edit-form.php
|
||||||
$post_pingback = get_settings('default_pingback_flag');
|
$post_pingback = get_settings('default_pingback_flag');
|
||||||
|
@ -236,7 +236,41 @@ function sanitize_title_with_dashes($title) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function convert_chars($content, $flag = 'obsolete') {
|
function convert_chars($content, $flag = 'obsolete') {
|
||||||
global $wp_htmltranswinuni;
|
// Translation of invalid Unicode references range to valid range
|
||||||
|
$wp_htmltranswinuni = array(
|
||||||
|
'€' => '€', // the Euro sign
|
||||||
|
'' => '',
|
||||||
|
'‚' => '‚', // these are Windows CP1252 specific characters
|
||||||
|
'ƒ' => 'ƒ', // they would look weird on non-Windows browsers
|
||||||
|
'„' => '„',
|
||||||
|
'…' => '…',
|
||||||
|
'†' => '†',
|
||||||
|
'‡' => '‡',
|
||||||
|
'ˆ' => 'ˆ',
|
||||||
|
'‰' => '‰',
|
||||||
|
'Š' => 'Š',
|
||||||
|
'‹' => '‹',
|
||||||
|
'Œ' => 'Œ',
|
||||||
|
'' => '',
|
||||||
|
'Ž' => 'ž',
|
||||||
|
'' => '',
|
||||||
|
'' => '',
|
||||||
|
'‘' => '‘',
|
||||||
|
'’' => '’',
|
||||||
|
'“' => '“',
|
||||||
|
'”' => '”',
|
||||||
|
'•' => '•',
|
||||||
|
'–' => '–',
|
||||||
|
'—' => '—',
|
||||||
|
'˜' => '˜',
|
||||||
|
'™' => '™',
|
||||||
|
'š' => 'š',
|
||||||
|
'›' => '›',
|
||||||
|
'œ' => 'œ',
|
||||||
|
'' => '',
|
||||||
|
'ž' => '',
|
||||||
|
'Ÿ' => 'Ÿ'
|
||||||
|
);
|
||||||
|
|
||||||
// Remove metadata tags
|
// Remove metadata tags
|
||||||
$content = preg_replace('/<title>(.+?)<\/title>/','',$content);
|
$content = preg_replace('/<title>(.+?)<\/title>/','',$content);
|
||||||
@ -255,6 +289,49 @@ function convert_chars($content, $flag = 'obsolete') {
|
|||||||
return $content;
|
return $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function funky_javascript_fix($text) {
|
||||||
|
// Fixes for browsers' javascript bugs
|
||||||
|
global $is_macIE, $is_winIE, $is_gecko;
|
||||||
|
$wp_macIE_correction['in'] = array(
|
||||||
|
'/\%uFFD4/', '/\%uFFD5/', '/\%uFFD2/', '/\%uFFD3/',
|
||||||
|
'/\%uFFA5/', '/\%uFFD0/', '/\%uFFD1/', '/\%uFFBD/',
|
||||||
|
'/\%uFF83%uFFC0/', '/\%uFF83%uFFC1/', '/\%uFF83%uFFC6/', '/\%uFF83%uFFC9/',
|
||||||
|
'/\%uFFB9/', '/\%uFF81%uFF8C/', '/\%uFF81%uFF8D/', '/\%uFF81%uFFDA/',
|
||||||
|
'/\%uFFDB/'
|
||||||
|
);
|
||||||
|
$wp_macIE_correction['out'] = array(
|
||||||
|
'‘', '’', '“', '”',
|
||||||
|
'•', '–', '—', 'Ω',
|
||||||
|
'β', 'γ', 'θ', 'λ',
|
||||||
|
'π', '′', '″', '∠',
|
||||||
|
'€'
|
||||||
|
);
|
||||||
|
$wp_gecko_correction['in'] = array(
|
||||||
|
'/\‘/', '/\’/', '/\“/', '/\”/',
|
||||||
|
'/\•/', '/\–/', '/\—/', '/\O/',
|
||||||
|
'/\ß/', '/\?/', '/\?/', '/\?/',
|
||||||
|
'/\p/', '/\'/', '/\?/', '/\/',
|
||||||
|
'/\€/', '/\?/'
|
||||||
|
);
|
||||||
|
$wp_gecko_correction['out'] = array(
|
||||||
|
'&8216;', '’', '“', '”',
|
||||||
|
'•', '–', '—', 'Ω',
|
||||||
|
'β', 'γ', 'θ', 'λ',
|
||||||
|
'π', '′', '″', '∠',
|
||||||
|
'€', ' '
|
||||||
|
);
|
||||||
|
if ( $is_macIE )
|
||||||
|
$text = preg_replace('/'.$wp_macIE_correction["in"].'/', '/'.$wp_macIE_correction["out"].'/', $text);
|
||||||
|
|
||||||
|
if ( $is_winIE )
|
||||||
|
$text = preg_replace("/\%u([0-9A-F]{4,4})/e", "'&#'.base_convert('\\1',16,10).';'", $text);
|
||||||
|
|
||||||
|
if ( $is_gecko )
|
||||||
|
$text = preg_replace('/'.$wp_gecko_correction["in"].'/','/'.$wp_gecko_correction["out"].'/',$text);
|
||||||
|
|
||||||
|
return $text;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
balanceTags
|
balanceTags
|
||||||
|
|
||||||
|
@ -3,42 +3,6 @@
|
|||||||
/* This file sets various arrays and variables for use in WordPress */
|
/* This file sets various arrays and variables for use in WordPress */
|
||||||
require(ABSPATH . 'wp-includes/version.php');
|
require(ABSPATH . 'wp-includes/version.php');
|
||||||
|
|
||||||
# Translation of invalid Unicode references range to valid range
|
|
||||||
$wp_htmltranswinuni = array(
|
|
||||||
'€' => '€', // the Euro sign
|
|
||||||
'' => '',
|
|
||||||
'‚' => '‚', // these are Windows CP1252 specific characters
|
|
||||||
'ƒ' => 'ƒ', // they would look weird on non-Windows browsers
|
|
||||||
'„' => '„',
|
|
||||||
'…' => '…',
|
|
||||||
'†' => '†',
|
|
||||||
'‡' => '‡',
|
|
||||||
'ˆ' => 'ˆ',
|
|
||||||
'‰' => '‰',
|
|
||||||
'Š' => 'Š',
|
|
||||||
'‹' => '‹',
|
|
||||||
'Œ' => 'Œ',
|
|
||||||
'' => '',
|
|
||||||
'Ž' => 'ž',
|
|
||||||
'' => '',
|
|
||||||
'' => '',
|
|
||||||
'‘' => '‘',
|
|
||||||
'’' => '’',
|
|
||||||
'“' => '“',
|
|
||||||
'”' => '”',
|
|
||||||
'•' => '•',
|
|
||||||
'–' => '–',
|
|
||||||
'—' => '—',
|
|
||||||
'˜' => '˜',
|
|
||||||
'™' => '™',
|
|
||||||
'š' => 'š',
|
|
||||||
'›' => '›',
|
|
||||||
'œ' => 'œ',
|
|
||||||
'' => '',
|
|
||||||
'ž' => '',
|
|
||||||
'Ÿ' => 'Ÿ'
|
|
||||||
);
|
|
||||||
|
|
||||||
// On which page are we ?
|
// On which page are we ?
|
||||||
$PHP_SELF = $_SERVER['PHP_SELF'];
|
$PHP_SELF = $_SERVER['PHP_SELF'];
|
||||||
if (preg_match('#([^/]+.php)#', $PHP_SELF, $self_matches)) {
|
if (preg_match('#([^/]+.php)#', $PHP_SELF, $self_matches)) {
|
||||||
@ -75,36 +39,6 @@ if (preg_match('/Lynx/', $HTTP_USER_AGENT)) {
|
|||||||
}
|
}
|
||||||
$is_IE = (($is_macIE) || ($is_winIE));
|
$is_IE = (($is_macIE) || ($is_winIE));
|
||||||
|
|
||||||
// browser-specific javascript corrections
|
|
||||||
$wp_macIE_correction['in'] = array(
|
|
||||||
'/\%uFFD4/', '/\%uFFD5/', '/\%uFFD2/', '/\%uFFD3/',
|
|
||||||
'/\%uFFA5/', '/\%uFFD0/', '/\%uFFD1/', '/\%uFFBD/',
|
|
||||||
'/\%uFF83%uFFC0/', '/\%uFF83%uFFC1/', '/\%uFF83%uFFC6/', '/\%uFF83%uFFC9/',
|
|
||||||
'/\%uFFB9/', '/\%uFF81%uFF8C/', '/\%uFF81%uFF8D/', '/\%uFF81%uFFDA/',
|
|
||||||
'/\%uFFDB/'
|
|
||||||
);
|
|
||||||
$wp_macIE_correction['out'] = array(
|
|
||||||
'‘', '’', '“', '”',
|
|
||||||
'•', '–', '—', 'Ω',
|
|
||||||
'β', 'γ', 'θ', 'λ',
|
|
||||||
'π', '′', '″', '∠',
|
|
||||||
'€'
|
|
||||||
);
|
|
||||||
$wp_gecko_correction['in'] = array(
|
|
||||||
'/\‘/', '/\’/', '/\“/', '/\”/',
|
|
||||||
'/\•/', '/\–/', '/\—/', '/\Ω/',
|
|
||||||
'/\β/', '/\γ/', '/\θ/', '/\λ/',
|
|
||||||
'/\π/', '/\′/', '/\″/', '/\/',
|
|
||||||
'/\€/', '/\ /'
|
|
||||||
);
|
|
||||||
$wp_gecko_correction['out'] = array(
|
|
||||||
'&8216;', '’', '“', '”',
|
|
||||||
'•', '–', '—', 'Ω',
|
|
||||||
'β', 'γ', 'θ', 'λ',
|
|
||||||
'π', '′', '″', '∠',
|
|
||||||
'€', ' '
|
|
||||||
);
|
|
||||||
|
|
||||||
// Server detection
|
// Server detection
|
||||||
$is_apache = strstr($_SERVER['SERVER_SOFTWARE'], 'Apache') ? 1 : 0;
|
$is_apache = strstr($_SERVER['SERVER_SOFTWARE'], 'Apache') ? 1 : 0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user