Make WordPress Core

Changeset 354


Ignore:
Timestamp:
09/02/2003 11:22:04 PM (23 years ago)
Author:
mikelittle
Message:

Fixes from Patrick MARIE <mycroft@…>
regarding un-initialized vars.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/b2-include/b2functions.php

    r345 r354  
    1717/***** Formatting functions *****/
    1818function wptexturize($text) {
     19        $output = "";
    1920        $textarr = preg_split("/(<.*>)/U", $text, -1, PREG_SPLIT_DELIM_CAPTURE); // capture the tags as well as in between
    2021        $stop = count($textarr); $next = true; // loop stuff
    … …  
    2526                        $curl = str_replace('</q>', '&#8221;', $curl);
    2627                }
    27                 if ('<' != $curl{0} && $next) { // If it's not a tag
     28                if (isset($curl{0}) && '<' != $curl{0} && $next) { // If it's not a tag
    2829                        $curl = str_replace('---', '&#8212;', $curl);
    2930                        $curl = str_replace('--', '&#8211;', $curl);
    … …  
    3637                        $curl = str_replace($cockney, $cockneyreplace, $curl);
    3738
    38                
    3939                        $curl = preg_replace("/'s/", "&#8217;s", $curl);
    4040                        $curl = preg_replace("/'(\d\d(?:&#8217;|')?s)/", "&#8217;$1", $curl);
    … …  
    219219
    220220                // converts HTML-entities to their display values in order to convert them again later
    221                 $content = preg_replace('/['.chr(127).'-'.chr(255).']/e', '"&#".ord(\0).";"', $content );
     221                $content = preg_replace('/['.chr(127).'-'.chr(255).']/e', '"&#".ord(\'\0\').";"', $content );
    222222                $content = strtr($content, $b2_htmltrans);
    223223
    … …  
    272272        global $smilies_directory, $use_smilies;
    273273        global $b2_smiliessearch, $b2_smiliesreplace;
     274
    274275        if ($use_smilies) {
    275276                // HTML loop taken from texturize function, could possible be consolidated
    … …  
    283284                        $output .= $content;
    284285                }
     286        } else {
     287                // return default text.
     288                $output = $text;
    285289        }
    286290        return $output;
    … …  
    12811285}
    12821286
    1283 
    12841287?>
  • trunk/b2calendar.php

    r213 r354  
    5858
    5959$w = $HTTP_GET_VARS['w'];
     60if (isset($HTTP_GET_VARS['w'])) {
     61    $w = $HTTP_GET_VARS['w'];
     62}
    6063
    6164if (isset($calendar) && ($calendar != '')) {
Note: See TracChangeset for help on using the changeset viewer.