Fixes from Patrick MARIE <mycroft@virgaria.org>
regarding un-initialized vars. git-svn-id: http://svn.automattic.com/wordpress/trunk@354 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
88a6405b15
commit
f766194481
|
@ -16,6 +16,7 @@ if (!function_exists('floatval')) {
|
|||
|
||||
/***** Formatting functions *****/
|
||||
function wptexturize($text) {
|
||||
$output = "";
|
||||
$textarr = preg_split("/(<.*>)/U", $text, -1, PREG_SPLIT_DELIM_CAPTURE); // capture the tags as well as in between
|
||||
$stop = count($textarr); $next = true; // loop stuff
|
||||
for ($i = 0; $i < $stop; $i++) {
|
||||
|
@ -24,7 +25,7 @@ function wptexturize($text) {
|
|||
$curl = str_replace('<q>', '“', $curl);
|
||||
$curl = str_replace('</q>', '”', $curl);
|
||||
}
|
||||
if ('<' != $curl{0} && $next) { // If it's not a tag
|
||||
if (isset($curl{0}) && '<' != $curl{0} && $next) { // If it's not a tag
|
||||
$curl = str_replace('---', '—', $curl);
|
||||
$curl = str_replace('--', '–', $curl);
|
||||
$curl = str_replace("...", '…', $curl);
|
||||
|
@ -35,7 +36,6 @@ function wptexturize($text) {
|
|||
$cockneyreplace = array("’tain’t","’twere","’twas","’tis","’twill","’til","’bout","’nuff","’round");
|
||||
$curl = str_replace($cockney, $cockneyreplace, $curl);
|
||||
|
||||
|
||||
$curl = preg_replace("/'s/", "’s", $curl);
|
||||
$curl = preg_replace("/'(\d\d(?:’|')?s)/", "’$1", $curl);
|
||||
$curl = preg_replace('/(\s|\A|")\'/', '$1‘', $curl);
|
||||
|
@ -218,7 +218,7 @@ function convert_chars($content,$flag='obsolete attribute left there for backwar
|
|||
$content = preg_replace('/&[^#](?![a-z]*;)/ie', '"&".substr("\0",1)', $content);
|
||||
|
||||
// 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 = preg_replace('/['.chr(127).'-'.chr(255).']/e', '"&#".ord(\'\0\').";"', $content );
|
||||
$content = strtr($content, $b2_htmltrans);
|
||||
|
||||
// now converting: Windows CP1252 => Unicode (valid HTML)
|
||||
|
@ -271,6 +271,7 @@ function convert_gmcode($content) {
|
|||
function convert_smilies($text) {
|
||||
global $smilies_directory, $use_smilies;
|
||||
global $b2_smiliessearch, $b2_smiliesreplace;
|
||||
|
||||
if ($use_smilies) {
|
||||
// HTML loop taken from texturize function, could possible be consolidated
|
||||
$textarr = preg_split("/(<.*>)/U", $text, -1, PREG_SPLIT_DELIM_CAPTURE); // capture the tags as well as in between
|
||||
|
@ -282,6 +283,9 @@ function convert_smilies($text) {
|
|||
}
|
||||
$output .= $content;
|
||||
}
|
||||
} else {
|
||||
// return default text.
|
||||
$output = $text;
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
@ -1280,5 +1284,4 @@ function pingGeoURL($blog_ID) {
|
|||
getRemoteFile($host,$path);
|
||||
}
|
||||
|
||||
|
||||
?>
|
|
@ -57,6 +57,9 @@ require_once($abspath.$b2inc.'/b2functions.php');
|
|||
require_once($abspath.$b2inc.'/b2vars.php');
|
||||
|
||||
$w = $HTTP_GET_VARS['w'];
|
||||
if (isset($HTTP_GET_VARS['w'])) {
|
||||
$w = $HTTP_GET_VARS['w'];
|
||||
}
|
||||
|
||||
if (isset($calendar) && ($calendar != '')) {
|
||||
$thisyear = substr($calendar,0,4);
|
||||
|
|
Loading…
Reference in New Issue