Changeset 119
- Timestamp:
- 10/27/05 22:10:18 (3 years ago)
- Files:
-
- tags/0.6RC/dev/wordpress_patch_history.txt (modified) (1 diff)
- trunk/dev/wordpress_patch_history.txt (modified) (1 diff)
- trunk/src/lyceum/wp-admin/admin-functions.php (modified) (4 diffs)
- trunk/src/lyceum/wp-admin/image-uploading.php (modified) (1 diff)
- trunk/src/lyceum/wp-admin/install.php (modified) (1 diff)
- trunk/src/lyceum/wp-admin/upgrade-functions.php (modified) (3 diffs)
- trunk/src/lyceum/wp-admin/upgrade-schema.php (modified) (1 diff)
- trunk/src/lyceum/wp-includes/classes.php (modified) (1 diff)
- trunk/src/lyceum/wp-includes/functions.php (modified) (1 diff)
- trunk/src/lyceum/wp-includes/version.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
tags/0.6RC/dev/wordpress_patch_history.txt
r88 r119 26 26 2962 complete merge 27 27 2963 complete merge 28 2964 complete merge trunk/dev/wordpress_patch_history.txt
r88 r119 26 26 2962 complete merge 27 27 2963 complete merge 28 2965 complete merge 29 2966 complete merge 30 2967 complete merge 31 2968 complete merge trunk/src/lyceum/wp-admin/admin-functions.php
r70 r119 1521 1521 1522 1522 $path = ABSPATH . $dir; 1523 1524 // Give the new dirs the same perms as wp-content. 1525 $stat = stat(ABSPATH . 'wp-content'); 1526 $dir_perms = $stat['mode'] & 0000777; // Get the permission bits. 1523 1527 1524 1528 // Make sure we have an uploads dir … … 1526 1530 if ( ! mkdir( $path ) ) 1527 1531 return array('error' => "Unable to create directory $path. Is its parent directory writable by the server?"); 1528 @ chmod( ABSPATH . $path, 0774);1532 @ chmod( $path, $dir_perms ); 1529 1533 } 1530 1534 … … 1540 1544 if ( ! mkdir( $pathy ) ) 1541 1545 return array('error' => "Unable to create directory $pathy. Is $path writable?"); 1542 @ chmod( $pathy, 0774);1546 @ chmod( $pathy, $dir_perms ); 1543 1547 } 1544 1548 … … 1547 1551 if ( ! mkdir( $pathym ) ) 1548 1552 return array('error' => "Unable to create directory $pathym. Is $pathy writable?"); 1549 @ chmod( $pathym, 0774);1553 @ chmod( $pathym, $dir_perms ); 1550 1554 } 1551 1555 trunk/src/lyceum/wp-admin/image-uploading.php
r62 r119 114 114 if ( false === move_uploaded_file($_FILES['image']['tmp_name'], $file) ) 115 115 die('The uploaded file could not be moved to $file.'); 116 chmod($file, 0 775);116 chmod($file, 0666); // FIXME: Need to set this according to rw bits on parent dir. 117 117 118 118 // Compute the URL trunk/src/lyceum/wp-admin/install.php
r98 r119 148 148 make_db_current_silent(); 149 149 //populate_options(); 150 populate_roles(); 150 151 151 152 // Set up admin user trunk/src/lyceum/wp-admin/upgrade-functions.php
r2 r119 5 5 // Functions to be called in install and upgrade scripts 6 6 function upgrade_all() { 7 global $wp_current_db_version, $wp_db_version; 8 $wp_current_db_version = __get_option('db_version'); 9 10 // We are up-to-date. Nothing to do. 11 if ( $wp_db_version == $wp_current_db_version ) 12 return; 13 14 // If the version is not set in the DB, try to guess the version. 15 if ( empty($wp_current_db_version) ) { 16 $wp_current_db_version = 0; 17 18 // If the template option exists, we have 1.5. 19 $template = __get_option('template'); 20 if ( !empty($template) ) 21 $wp_current_db_version = 2541; 22 } 23 7 24 populate_options(); 8 upgrade_100(); 9 upgrade_101(); 10 upgrade_110(); 11 upgrade_130(); 12 upgrade_160(); 25 26 if ( $wp_current_db_version < 2541 ) { 27 upgrade_100(); 28 upgrade_101(); 29 upgrade_110(); 30 upgrade_130(); 31 } 32 33 if ( $wp_current_db_version < 2966 ) 34 upgrade_160(); 35 13 36 save_mod_rewrite_rules(); 37 38 update_option('db_version', $wp_db_version); 14 39 } 15 40 … … 83 108 84 109 function upgrade_110() { 85 global $wpdb;110 global $wpdb; 86 111 87 112 // Set user_nicename. 88 // FIXME: user_nickname is no longer in the user table. Need to update and 89 // move this code to where the new usermeta table is setup. 90 // $users = $wpdb->get_results("SELECT ID, user_nickname, user_nicename FROM $wpdb->users"); 91 // foreach ($users as $user) { 92 // if ('' == $user->user_nicename) { 93 // $newname = sanitize_title($user->user_nickname); 94 // $wpdb->query("UPDATE $wpdb->users SET user_nicename = '$newname' WHERE ID = '$user->ID'"); 95 // } 96 // } 113 $users = $wpdb->get_results("SELECT ID, user_nickname, user_nicename FROM $wpdb->users"); 114 foreach ($users as $user) { 115 if ('' == $user->user_nicename) { 116 $newname = sanitize_title($user->user_nickname); 117 $wpdb->query("UPDATE $wpdb->users SET user_nicename = '$newname' WHERE ID = '$user->ID'"); 118 } 119 } 97 120 98 121 $users = $wpdb->get_results("SELECT ID, user_pass from $wpdb->users"); … … 219 242 function upgrade_160() { 220 243 global $wpdb, $table_prefix; 244 245 populate_roles_160(); 246 221 247 $users = $wpdb->get_results("SELECT * FROM $wpdb->users"); 222 248 foreach ( $users as $user ) : trunk/src/lyceum/wp-admin/upgrade-schema.php
r77 r119 256 256 //jjb TODO make add_cap blog-specific? 257 257 function populate_roles() { 258 populate_roles_160(); 259 } 260 261 function populate_roles_160() { 258 262 global $wp_roles; 259 263 // Add roles trunk/src/lyceum/wp-includes/classes.php
r90 r119 439 439 // Category stuff for nice URIs 440 440 441 global $cache_categories; 441 442 if ('' != $q['category_name']) { 442 if (stristr($q['category_name'],'/')) { 443 $q['category_name'] = explode('/',$q['category_name']); 444 if ($q['category_name'][count($q['category_name'])-1]) { 445 $q['category_name'] = $q['category_name'][count($q['category_name'])-1]; // no trailing slash 446 } else { 447 $q['category_name'] = $q['category_name'][count($q['category_name'])-2]; // there was a trailling slash 448 } 449 } 450 $q['category_name'] = sanitize_title($q['category_name']); 443 $cat_paths = '/' . trim(urldecode($q['category_name']), '/'); 444 $q['category_name'] = sanitize_title(basename($cat_paths)); 445 $cat_paths = explode('/', $cat_paths); 446 foreach($cat_paths as $pathdir) 447 $cat_path .= ($pathdir!=''?'/':'') . sanitize_title($pathdir); 448 449 $q['cat'] = array_reduce( 450 $cache_categories, 451 create_function('$a, $b', 'return ($b->fullpath == "'.$cat_path.'") ? $b->cat_ID : $a;'), 452 0 453 ); 454 455 // If full path not found, look for last dir as category ignoring parent 456 if($q['cat'] == 0) { 457 $q['cat'] = array_reduce( 458 $cache_categories, 459 create_function('$a, $b', 'return ($b->category_nicename == "'.$q['category_name'].'") ? $b->cat_ID : $a;'), 460 0 461 ); 462 } 463 451 464 $tables = ", $wpdb->post2cat, $wpdb->categories"; 452 465 $join = " LEFT JOIN $wpdb->post2cat ON ($wpdb->posts.ID = $wpdb->post2cat.post_id) LEFT JOIN $wpdb->categories ON ($wpdb->post2cat.category_id = $wpdb->categories.cat_ID) "; 453 454 455 $whichcat = " AND (category_nicename = '" . $q['category_name'] . "'"; 456 $q['cat'] = $wpdb->get_var("SELECT cat_ID FROM $wpdb->categories WHERE blog='$blog' AND category_nicename = '" . $q['category_name'] . "'");//lyceum 466 $whichcat = " AND (category_id = '" . $q['cat'] . "'"; 457 467 $whichcat .= get_category_children($q['cat'], " OR category_id = "); 458 468 $whichcat .= ")"; trunk/src/lyceum/wp-includes/functions.php
r98 r119 1322 1322 function update_category_cache() { 1323 1323 global $cache_categories, $wpdb, $blog; 1324 if ($dogs = $wpdb->get_results("SELECT * FROM $wpdb->categories WHERE blog = '$blog'"))://lyceum1324 if ( $dogs = $wpdb->get_results("SELECT * FROM $wpdb->categories WHERE blog = '$blog'") ): 1325 1325 foreach ($dogs as $catt) 1326 1326 $cache_categories[$catt->cat_ID] = $catt; 1327 1328 foreach ($cache_categories as $catt) { 1329 $curcat = $catt->cat_ID; 1330 $cache_categories[$catt->cat_ID]->fullpath = '/' . $cache_categories[$catt->cat_ID]->category_nicename; 1331 while ($cache_categories[$curcat]->category_parent != 0) { 1332 $curcat = $cache_categories[$curcat]->category_parent; 1333 $cache_categories[$catt->cat_ID]->fullpath = '/' . $cache_categories[$curcat]->category_nicename . $cache_categories[$catt->cat_ID]->fullpath; 1334 } 1335 } 1327 1336 return true; 1328 1337 else : trunk/src/lyceum/wp-includes/version.php
r90 r119 4 4 5 5 $wp_version = '0.6RC'; 6 $wp_db_version = 2966; 6 7 7 8 ?>
