Fixes from Patrick MARIE <mycroft@virgaria.org>

regarding un-initialized vars.


git-svn-id: https://develop.svn.wordpress.org/trunk@354 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mike Little 2003-09-02 23:22:04 +00:00
parent e40c7a30f8
commit 030bbb2018
2 changed files with 10 additions and 4 deletions

View File

@ -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>', '&#8220;', $curl);
$curl = str_replace('</q>', '&#8221;', $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('---', '&#8212;', $curl);
$curl = str_replace('--', '&#8211;', $curl);
$curl = str_replace("...", '&#8230;', $curl);
@ -35,7 +36,6 @@ function wptexturize($text) {
$cockneyreplace = array("&#8217;tain&#8217;t","&#8217;twere","&#8217;twas","&#8217;tis","&#8217;twill","&#8217;til","&#8217;bout","&#8217;nuff","&#8217;round");
$curl = str_replace($cockney, $cockneyreplace, $curl);
$curl = preg_replace("/'s/", "&#8217;s", $curl);
$curl = preg_replace("/'(\d\d(?:&#8217;|')?s)/", "&#8217;$1", $curl);
$curl = preg_replace('/(\s|\A|")\'/', '$1&#8216;', $curl);
@ -218,7 +218,7 @@ function convert_chars($content,$flag='obsolete attribute left there for backwar
$content = preg_replace('/&[^#](?![a-z]*;)/ie', '"&#38;".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);
}
?>

View File

@ -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);