Make WordPress Core

Changeset 4634


Ignore:
Timestamp:
12/09/2006 06:35:22 AM (18 years ago)
Author:
markjaquith
Message:

Init strings before concatenation. Props devil1591. fixes #3457

Location:
trunk/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/category.php

    r4627 r4634  
    170170    $leaf_path  = sanitize_title(basename($category_paths));
    171171    $category_paths = explode('/', $category_paths);
    172     foreach($category_paths as $pathdir)
    173         $full_path .= ($pathdir!=''?'/':'') . sanitize_title($pathdir);
     172    $full_path = '';
     173    foreach ( (array) $category_paths as $pathdir )
     174        $full_path .= ( $pathdir != '' ? '/' : '' ) . sanitize_title($pathdir);
    174175
    175176    $categories = $wpdb->get_results("SELECT cat_ID, category_nicename, category_parent FROM $wpdb->categories WHERE category_nicename = '$leaf_path'");
  • trunk/wp-includes/query.php

    r4618 r4634  
    820820            $q['category_name'] = sanitize_title(basename($cat_paths));
    821821            $cat_paths = explode('/', $cat_paths);
    822             foreach($cat_paths as $pathdir)
    823                 $cat_path .= ($pathdir!=''?'/':'') . sanitize_title($pathdir);
     822            $cat_path = '';
     823            foreach ( (array) $cat_paths as $pathdir )
     824                $cat_path .= ( $pathdir != '' ? '/' : '' ) . sanitize_title($pathdir);
    824825
    825826            //if we don't match the entire hierarchy fallback on just matching the nicename
Note: See TracChangeset for help on using the changeset viewer.