summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2006-02-17 15:23:24 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2006-02-17 15:23:24 +0000
commit846bc9c6e2301ad46376af0362091e2b0c391521 (patch)
tree56a2cf910f1c0fb4cc3762589760b52f63da3e4c
parentf3af365bb32a140aa1379f35b2b8606d6a950ebe (diff)
downloadwordpress-mu-846bc9c6e2301ad46376af0362091e2b0c391521.tar.gz
wordpress-mu-846bc9c6e2301ad46376af0362091e2b0c391521.tar.xz
wordpress-mu-846bc9c6e2301ad46376af0362091e2b0c391521.zip
WP Merge
Fix for pages not displaying git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@530 7be80a69-a1ef-0310-a953-fb0f7c49ff36
-rw-r--r--wp-inst/wp-admin/admin-functions.php52
-rw-r--r--wp-inst/wp-admin/admin-header.php4
-rw-r--r--wp-inst/wp-admin/categories.php2
-rw-r--r--wp-inst/wp-admin/edit-comments.php4
-rw-r--r--wp-inst/wp-admin/edit-page-form.php4
-rw-r--r--wp-inst/wp-admin/edit-pages.php4
-rw-r--r--wp-inst/wp-admin/inline-uploading.php8
-rw-r--r--wp-inst/wp-admin/link-import.php2
-rw-r--r--wp-inst/wp-admin/menu-header.php2
-rw-r--r--wp-inst/wp-admin/menu.php45
-rw-r--r--wp-inst/wp-admin/options-general.php2
-rw-r--r--wp-inst/wp-admin/options-misc.php2
-rw-r--r--wp-inst/wp-admin/options-reading.php2
-rw-r--r--wp-inst/wp-admin/options-writing.php2
-rw-r--r--wp-inst/wp-admin/page-new.php2
-rw-r--r--wp-inst/wp-admin/plugin-editor.php2
-rw-r--r--wp-inst/wp-admin/templates.php2
-rw-r--r--wp-inst/wp-admin/theme-editor.php4
-rw-r--r--wp-inst/wp-admin/users.php2
-rw-r--r--wp-inst/wp-comments-post.php2
-rw-r--r--wp-inst/wp-includes/comment-functions.php2
-rw-r--r--wp-inst/wp-includes/functions-post.php5
-rw-r--r--wp-inst/wp-includes/functions.php4
-rw-r--r--wp-inst/wp-includes/template-functions-category.php2
-rw-r--r--wp-inst/wp-includes/template-functions-links.php13
-rw-r--r--wp-inst/wp-login.php2
-rw-r--r--wp-inst/wp-register.php4
27 files changed, 122 insertions, 59 deletions
diff --git a/wp-inst/wp-admin/admin-functions.php b/wp-inst/wp-admin/admin-functions.php
index 61d0097..dacbe6e 100644
--- a/wp-inst/wp-admin/admin-functions.php
+++ b/wp-inst/wp-admin/admin-functions.php
@@ -610,7 +610,6 @@ function cat_rows($parent = 0, $level = 0, $categories = 0) {
foreach ($categories as $category) {
if ($category->category_parent == $parent) {
$category->cat_name = wp_specialchars($category->cat_name);
- //$count = $wpdb->get_var("SELECT COUNT(post_id) FROM $wpdb->post2cat WHERE category_id = $category->cat_ID");
$pad = str_repeat('&#8212; ', $level);
if ( current_user_can('manage_categories') ) {
$edit = "<a href='categories.php?action=edit&amp;cat_ID=$category->cat_ID' class='edit'>".__('Edit')."</a></td>";
@@ -630,7 +629,6 @@ function cat_rows($parent = 0, $level = 0, $categories = 0) {
<td>$category->category_count</td>
<td>$edit</td>
</tr>";
- //<td>$count</td>
cat_rows($category->cat_ID, $level +1, $categories);
}
}
@@ -1233,32 +1231,37 @@ function user_can_access_admin_page() {
global $pagenow;
global $menu;
global $submenu;
+ global $menu_nopriv;
$parent = get_admin_page_parent();
+
+ if ( isset($menu_nopriv[$pagenow]) )
+ return false;
- foreach ($menu as $menu_array) {
- //echo "parent array: " . $menu_array[2];
- if ($menu_array[2] == $parent) {
- if (!current_user_can($menu_array[1])) {
- return false;
- } else {
- break;
- }
- }
- }
+ if ( empty($parent) )
+ return true;
if (isset ($submenu[$parent])) {
foreach ($submenu[$parent] as $submenu_array) {
if ($submenu_array[2] == $pagenow) {
- if (!current_user_can($submenu_array[1])) {
- return false;
- } else {
+ if (current_user_can($submenu_array[1]))
return true;
- }
+ else
+ return false;
}
}
}
+ foreach ($menu as $menu_array) {
+ //echo "parent array: " . $menu_array[2];
+ if ($menu_array[2] == $parent) {
+ if (current_user_can($menu_array[1]))
+ return true;
+ else
+ return false;
+ }
+ }
+
return true;
}
@@ -1315,8 +1318,12 @@ function get_admin_page_parent() {
global $submenu;
global $pagenow;
global $plugin_page;
+ global $real_parent_file;
+
+ if ( !empty ($parent_file) ) {
+ if ( isset($real_parent_file[$parent_file]) )
+ $parent_file = $real_parent_file[$parent_file];
- if (isset ($parent_file) && !empty ($parent_file)) {
return $parent_file;
}
@@ -1324,13 +1331,18 @@ function get_admin_page_parent() {
foreach ($menu as $parent_menu) {
if ($parent_menu[2] == $plugin_page) {
$parent_file = $plugin_page;
- return $plugin_page;
+ if ( isset($real_parent_file[$parent_file]) )
+ $parent_file = $real_parent_file[$parent_file];
+
+ return $parent_file;
}
}
}
foreach (array_keys($submenu) as $parent) {
foreach ($submenu[$parent] as $submenu_array) {
+ if ( isset($real_parent_file[$parent]) )
+ $parent = $real_parent_file[$parent];
if ($submenu_array[2] == $pagenow) {
$parent_file = $parent;
return $parent;
@@ -1365,8 +1377,12 @@ function add_menu_page($page_title, $menu_title, $access_level, $file, $function
function add_submenu_page($parent, $page_title, $menu_title, $access_level, $file, $function = '') {
global $submenu;
global $menu;
+ global $real_parent_file;
$parent = plugin_basename($parent);
+ if ( isset($real_parent_file[$parent]) )
+ $parent = $real_parent_file[$parent];
+
$file = plugin_basename($file);
// If the parent doesn't already have a submenu, add a link to the parent
diff --git a/wp-inst/wp-admin/admin-header.php b/wp-inst/wp-admin/admin-header.php
index b994f7c..a3cb034 100644
--- a/wp-inst/wp-admin/admin-header.php
+++ b/wp-inst/wp-admin/admin-header.php
@@ -1,4 +1,4 @@
-<?php
+<?php
@header('Content-type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
if (!isset($_GET["page"])) require_once('admin.php');
if ( $editing ) {
@@ -59,7 +59,7 @@ var manager = new dbxManager('pagemeta');
</head>
<body>
<div id="wphead">
-<h1><?php echo wptexturize(get_settings(('blogname'))); ?> <span>(<a href="<?php echo get_settings('home') . '/'; ?>"><?php _e('View site') ?> &raquo;</a>)</span></h1>
+<h1><?php echo wptexturize(get_settings(('blogname'))); ?> <span>(<a href="<?php echo get_settings('home') . '/'; ?>"><?php _e('View site &raquo;') ?></a>)</span></h1>
</div>
<div id="user_info"><p><?php printf(__('Howdy, <strong>%s</strong>.'), $user_identity) ?> [<a href="<?php echo get_settings('siteurl'); ?>/wp-login.php?action=logout" title="<?php _e('Log out of this account') ?>"><?php _e('Sign Out'); ?></a>, <a href="profile.php"><?php _e('My Account'); ?></a>] </p></div>
diff --git a/wp-inst/wp-admin/categories.php b/wp-inst/wp-admin/categories.php
index e9b4890..8a96872 100644
--- a/wp-inst/wp-admin/categories.php
+++ b/wp-inst/wp-admin/categories.php
@@ -92,7 +92,7 @@ case 'edit':
<td><textarea name="category_description" rows="5" cols="50" style="width: 97%;"><?php echo wp_specialchars($category->category_description, 1); ?></textarea></td>
</tr>
</table>
- <p class="submit"><input type="submit" name="submit" value="<?php _e('Edit category') ?> &raquo;" /></p>
+ <p class="submit"><input type="submit" name="submit" value="<?php _e('Edit category &raquo;') ?>" /></p>
</form>
<p><a href="categories.php"><?php _e('&laquo; Return to category list'); ?></a></p>
</div>
diff --git a/wp-inst/wp-admin/edit-comments.php b/wp-inst/wp-admin/edit-comments.php
index 1a5acdd..2a26f1f 100644
--- a/wp-inst/wp-admin/edit-comments.php
+++ b/wp-inst/wp-admin/edit-comments.php
@@ -163,8 +163,8 @@ if ('view' == $mode) {
} // end foreach
?></table>
<p><a href="javascript:;" onclick="checkAll(document.getElementById('deletecomments')); return false; "><?php _e('Invert Checkbox Selection') ?></a></p>
- <p class="submit"><input type="submit" name="delete_button" value="<?php _e('Delete Checked Comments') ?> &raquo;" onclick="return confirm('<?php _e("You are about to delete these comments permanently \\n \'Cancel\' to stop, \'OK\' to delete.") ?>')" />
- <input type="submit" name="spam_button" value="<?php _e('Mark Checked Comments as Spam') ?> &raquo;" onclick="return confirm('<?php _e("You are about to mark these comments as spam \\n \'Cancel\' to stop, \'OK\' to mark as spam.") ?>')" /></p>
+ <p class="submit"><input type="submit" name="delete_button" value="<?php _e('Delete Checked Comments &raquo;') ?>" onclick="return confirm('<?php _e("You are about to delete these comments permanently \\n \'Cancel\' to stop, \'OK\' to delete.") ?>')" />
+ <input type="submit" name="spam_button" value="<?php _e('Mark Checked Comments as Spam &raquo;') ?>" onclick="return confirm('<?php _e("You are about to mark these comments as spam \\n \'Cancel\' to stop, \'OK\' to mark as spam.") ?>')" /></p>
</form>
<?php
} else {
diff --git a/wp-inst/wp-admin/edit-page-form.php b/wp-inst/wp-admin/edit-page-form.php
index 2e3684c..0ce2ab1 100644
--- a/wp-inst/wp-admin/edit-page-form.php
+++ b/wp-inst/wp-admin/edit-page-form.php
@@ -183,9 +183,9 @@ else
<p class="submit">
<?php if ( $post_ID ) : ?>
<input name="save" type="submit" id="save" tabindex="5" value=" <?php _e('Save and Continue Editing'); ?> "/>
-<input name="savepage" type="submit" id="savepage" tabindex="6" value="<?php $post_ID ? _e('Save') : _e('Create New Page') ?> &raquo;" />
+<input name="savepage" type="submit" id="savepage" tabindex="6" value="<?php $post_ID ? _e('Save') : _e('Create New Page &raquo;') ?>" />
<?php else : ?>
-<input name="savepage" type="submit" id="savepage" tabindex="6" value="<?php _e('Create New Page') ?> &raquo;" />
+<input name="savepage" type="submit" id="savepage" tabindex="6" value="<?php _e('Create New Page &raquo;') ?>" />
<?php endif; ?>
<input name="referredby" type="hidden" id="referredby" value="<?php echo $sendto; ?>" />
</p>
diff --git a/wp-inst/wp-admin/edit-pages.php b/wp-inst/wp-admin/edit-pages.php
index 6729f1b..b3fd214 100644
--- a/wp-inst/wp-admin/edit-pages.php
+++ b/wp-inst/wp-admin/edit-pages.php
@@ -8,7 +8,7 @@ require_once('admin-header.php');
<div class="wrap">
<h2><?php _e('Page Management'); ?></h2>
-<p><?php _e('Pages are like posts except they live outside of the normal blog chronology and can be hierarchical. You can use pages to organize and manage any amount of content.'); ?> <a href="page-new.php"><?php _e('Create a new page'); ?> &raquo;</a></p>
+<p><?php _e('Pages are like posts except they live outside of the normal blog chronology and can be hierarchical. You can use pages to organize and manage any amount of content.'); ?> <a href="page-new.php"><?php _e('Create a new page &raquo;'); ?></a></p>
<form name="searchform" action="" method="get">
<fieldset>
@@ -72,7 +72,7 @@ endforeach;
} // end if ($posts)
?>
-<h3><a href="page-new.php"><?php _e('Create New Page'); ?> &raquo;</a></h3>
+<h3><a href="page-new.php"><?php _e('Create New Page &raquo;'); ?></a></h3>
</div>
diff --git a/wp-inst/wp-admin/inline-uploading.php b/wp-inst/wp-admin/inline-uploading.php
index f2a0b58..1e3b812 100644
--- a/wp-inst/wp-admin/inline-uploading.php
+++ b/wp-inst/wp-admin/inline-uploading.php
@@ -237,7 +237,7 @@ srcb[{$ID}] = '{$image['guid']}';
$xpadding = (128 - $image['uwidth']) / 2;
$ypadding = (96 - $image['uheight']) / 2;
$style .= "#target{$ID} img { padding: {$ypadding}px {$xpadding}px; }\n";
- $title = htmlentities($image['post_title'], ENT_QUOTES);
+ $title = wp_specialchars($image['post_title'], ENT_QUOTES);
$script .= "aa[{$ID}] = '<a id=\"p{$ID}\" rel=\"attachment\" class=\"imagelink\" href=\"$href\" onclick=\"doPopup({$ID});return false;\" title=\"{$title}\">';
ab[{$ID}] = '<a class=\"imagelink\" href=\"{$image['guid']}\" onclick=\"doPopup({$ID});return false;\" title=\"{$title}\">';
imga[{$ID}] = '<img id=\"image{$ID}\" src=\"$src\" alt=\"{$title}\" $height_width />';
@@ -257,7 +257,7 @@ imgb[{$ID}] = '<img id=\"image{$ID}\" src=\"{$image['guid']}\" alt=\"{$title}\"
</div>
";
} else {
- $title = htmlentities($attachment['post_title'], ENT_QUOTES);
+ $title = wp_specialchars($attachment['post_title'], ENT_QUOTES);
$filename = basename($attachment['guid']);
$icon = get_attachment_icon($ID);
$toggle_icon = "<a id=\"I{$ID}\" onclick=\"toggleOtherIcon({$ID});return false;\" href=\"javascript:void()\">$__using_title</a>";
@@ -659,10 +659,10 @@ th {
<li class="inactive">&laquo; <?php _e('Back'); ?></li>
<?php endif; ?>
<?php if ( false !== $next ) : ?>
-<li><a href="<?php echo basename(__FILE__); ?>?action=<?php echo $action; ?>&amp;post=<?php echo $post; ?>&amp;all=<?php echo $all; ?>&amp;start=<?php echo $next; ?>"><?php _e('Next'); ?> &raquo;</a></li>
+<li><a href="<?php echo basename(__FILE__); ?>?action=<?php echo $action; ?>&amp;post=<?php echo $post; ?>&amp;all=<?php echo $all; ?>&amp;start=<?php echo $next; ?>"><?php _e('Next &raquo;'); ?></a></li>
<li><a href="<?php echo basename(__FILE__); ?>?action=<?php echo $action; ?>&amp;post=<?php echo $post; ?>&amp;all=<?php echo $all; ?>&amp;last=true" title="<?php _e('Last'); ?>">&raquo;|</a></li>
<?php else : ?>
-<li class="inactive"><?php _e('Next'); ?> &raquo;</li>
+<li class="inactive"><?php _e('Next &raquo;'); ?></li>
<li class="inactive">&raquo;|</li>
<?php endif; ?>
<?php } // endif not upload?>
diff --git a/wp-inst/wp-admin/link-import.php b/wp-inst/wp-admin/link-import.php
index 713686b..58e58f8 100644
--- a/wp-inst/wp-admin/link-import.php
+++ b/wp-inst/wp-admin/link-import.php
@@ -54,7 +54,7 @@ foreach ($categories as $category) {
?>
</select></p>
-<p class="submit"><input type="submit" name="submit" value="<?php _e('Import OPML File') ?> &raquo;" /></p>
+<p class="submit"><input type="submit" name="submit" value="<?php _e('Import OPML File &raquo;') ?>" /></p>
</form>
</div>
diff --git a/wp-inst/wp-admin/menu-header.php b/wp-inst/wp-admin/menu-header.php
index aa318bb..416a229 100644
--- a/wp-inst/wp-admin/menu-header.php
+++ b/wp-inst/wp-admin/menu-header.php
@@ -11,7 +11,7 @@ foreach ($menu as $item) {
// 0 = name, 1 = capability, 2 = file
if (( strcmp($self, $item[2]) == 0 && empty($parent_file)) || ($parent_file && ($item[2] == $parent_file))) $class = ' class="current"';
- if ( current_user_can($item[1]) ) {
+ if ( !empty($submenu[$item[2]]) || current_user_can($item[1]) ) {
if ( file_exists(ABSPATH . "wp-content/plugins/{$item[2]}") )
echo "\n\t<li><a href='" . get_settings('siteurl') . "/wp-admin/admin.php?page={$item[2]}'$class>{$item[0]}</a></li>";
else
diff --git a/wp-inst/wp-admin/menu.php b/wp-inst/wp-admin/menu.php
index 8e420a7..2c446e6 100644
--- a/wp-inst/wp-admin/menu.php
+++ b/wp-inst/wp-admin/menu.php
@@ -58,6 +58,51 @@ $submenu['options-general.php'][25] = array(__('Discussion'), 'manage_options',
$submenu['themes.php'][5] = array(__('Themes'), 'switch_themes', 'themes.php');
+// Loop over submenus and remove pages for which the user does not have privs.
+foreach ($submenu as $parent => $sub) {
+ foreach ($sub as $index => $data) {
+ if ( ! current_user_can($data[1]) ) {
+ $menu_nopriv[$data[2]] = true;
+ unset($submenu[$parent][$index]);
+ }
+ }
+
+ if ( empty($submenu[$parent]) )
+ unset($submenu[$parent]);
+}
+
+// Loop over the top-level menu.
+// Remove menus that have no accessible submenus and require privs that the user does not have.
+// Menus for which the original parent is not acessible due to lack of privs will have the next
+// submenu in line be assigned as the new menu parent.
+foreach ( $menu as $id => $data ) {
+ // If submenu is empty...
+ if ( empty($submenu[$data[2]]) ) {
+ // And user doesn't have privs, remove menu.
+ if ( ! current_user_can($data[1]) ) {
+ $menu_nopriv[$data[2]] = true;
+ unset($menu[$id]);
+ }
+ } else {
+ $subs = $submenu[$data[2]];
+ $first_sub = array_shift($subs);
+ $old_parent = $data[2];
+ $new_parent = $first_sub[2];
+ // If the first submenu is not the same as the assigned parent,
+ // make the first submenu the new parent.
+ if ( $new_parent != $old_parent ) {
+ $real_parent_file[$old_parent] = $new_parent;
+ $menu[$id][2] = $new_parent;
+
+ foreach ($submenu[$old_parent] as $index => $data) {
+ $submenu[$new_parent][$index] = $submenu[$old_parent][$index];
+ unset($submenu[$old_parent][$index]);
+ }
+ unset($submenu[$old_parent]);
+ }
+ }
+}
+
get_currentuserinfo();
if( is_site_admin() ) {
$menu[1] = array(__('Site Admin'), '10', 'wpmu-admin.php' );
diff --git a/wp-inst/wp-admin/options-general.php b/wp-inst/wp-admin/options-general.php
index d6e6def..b05d865 100644
--- a/wp-inst/wp-admin/options-general.php
+++ b/wp-inst/wp-admin/options-general.php
@@ -104,7 +104,7 @@ endfor;
</table>
</fieldset>
-<p class="submit"><input type="submit" name="Submit" value="<?php _e('Update Options') ?> &raquo;" />
+<p class="submit"><input type="submit" name="Submit" value="<?php _e('Update Options &raquo;') ?>" />
<input type="hidden" name="action" value="update" />
<input type="hidden" name="page_options" value="blogname,blogdescription,users_can_register,gmt_offset,date_format,time_format,start_of_week,comment_registration, WPLANG" />
</p>
diff --git a/wp-inst/wp-admin/options-misc.php b/wp-inst/wp-admin/options-misc.php
index 96a41ab..4fdccdd 100644
--- a/wp-inst/wp-admin/options-misc.php
+++ b/wp-inst/wp-admin/options-misc.php
@@ -44,7 +44,7 @@ return;
<p class="submit">
<input type="hidden" name="action" value="update" />
<input type="hidden" name="page_options" value="hack_file,use_linksupdate,uploads_use_yearmonth_folders,upload_path" />
-<input type="submit" name="Submit" value="<?php _e('Update Options') ?> &raquo;" />
+<input type="submit" name="Submit" value="<?php _e('Update Options &raquo;') ?>" />
</p>
</form>
</div>
diff --git a/wp-inst/wp-admin/options-reading.php b/wp-inst/wp-admin/options-reading.php
index 578e937..ba0765b 100644
--- a/wp-inst/wp-admin/options-reading.php
+++ b/wp-inst/wp-admin/options-reading.php
@@ -52,7 +52,7 @@ include('admin-header.php');
<p class="submit">
<input type="hidden" name="action" value="update" />
<input type="hidden" name="page_options" value="posts_per_page,what_to_show,posts_per_rss,rss_use_excerpt,blog_charset,gzipcompression " />
-<input type="submit" name="Submit" value="<?php _e('Update Options') ?> &raquo;" />
+<input type="submit" name="Submit" value="<?php _e('Update Options &raquo;') ?>" />
</p>
</form>
</div>
diff --git a/wp-inst/wp-admin/options-writing.php b/wp-inst/wp-admin/options-writing.php
index fd14016..82c2ae6 100644
--- a/wp-inst/wp-admin/options-writing.php
+++ b/wp-inst/wp-admin/options-writing.php
@@ -45,7 +45,7 @@ endforeach;
<p class="submit">
<input type="hidden" name="action" value="update" />
<input type="hidden" name="page_options" value="default_post_edit_rows,use_smilies,ping_sites,mailserver_url,mailserver_port,mailserver_login,mailserver_pass,default_category,default_email_category,use_balanceTags" />
-<input type="submit" name="Submit" value="<?php _e('Update Options') ?> &raquo;" />
+<input type="submit" name="Submit" value="<?php _e('Update Options &raquo;') ?>" />
</p>
</form>
</div>
diff --git a/wp-inst/wp-admin/page-new.php b/wp-inst/wp-admin/page-new.php
index 9efbcd1..ba2ad2c 100644
--- a/wp-inst/wp-admin/page-new.php
+++ b/wp-inst/wp-admin/page-new.php
@@ -7,7 +7,7 @@ require_once('admin-header.php');
?>
<?php if ( isset($_GET['saved']) ) : ?>
-<div id="message" class="updated fade"><p><strong><?php _e('Page saved.') ?> <a href="edit-pages.php"><?php _e('Manage pages'); ?> &raquo;</a></strong></p></div>
+<div id="message" class="updated fade"><p><strong><?php _e('Page saved.') ?> <a href="edit-pages.php"><?php _e('Manage pages &raquo;'); ?></a></strong></p></div>
<?php endif; ?>
<?php
diff --git a/wp-inst/wp-admin/plugin-editor.php b/wp-inst/wp-admin/plugin-editor.php
index 2cfe7b8..739ccb5 100644
--- a/wp-inst/wp-admin/plugin-editor.php
+++ b/wp-inst/wp-admin/plugin-editor.php
@@ -103,7 +103,7 @@ if ($plugin_files) :
<?php if ( is_writeable($real_file) ) : ?>
<p class="submit">
<?php
- echo "<input type='submit' name='submit' value=' " . __('Update File') . " &raquo;' tabindex='2' />";
+ echo "<input type='submit' name='submit' value=' " . __('Update File &raquo;') . "' tabindex='2' />";
?>
</p>
<?php else : ?>
diff --git a/wp-inst/wp-admin/templates.php b/wp-inst/wp-admin/templates.php
index 1938174..c19dfa1 100644
--- a/wp-inst/wp-admin/templates.php
+++ b/wp-inst/wp-admin/templates.php
@@ -134,7 +134,7 @@ endif;
<?php if ( is_writeable($real_file) ) : ?>
<p class="submit">
<?php
- echo "<input type='submit' name='submit' value=' " . __('Update File') . " &raquo;' tabindex='2' />";
+ echo "<input type='submit' name='submit' value=' " . __('Update File &raquo;') . "' tabindex='2' />";
?>
</p>
<?php else : ?>
diff --git a/wp-inst/wp-admin/theme-editor.php b/wp-inst/wp-admin/theme-editor.php
index d54788b..153b04a 100644
--- a/wp-inst/wp-admin/theme-editor.php
+++ b/wp-inst/wp-admin/theme-editor.php
@@ -101,7 +101,7 @@ default:
}
?>
</select>
- <input type="submit" name="Submit" value="<?php _e('Select') ?> &raquo;" />
+ <input type="submit" name="Submit" value="<?php _e('Select &raquo;') ?>" />
</form>
</div>
@@ -138,7 +138,7 @@ if ($allowed_files) :
<?php if ( is_writeable($real_file) ) : ?>
<p class="submit">
<?php
- echo "<input type='submit' name='submit' value=' " . __('Update File') . " &raquo;' tabindex='2' />";
+ echo "<input type='submit' name='submit' value=' " . __('Update File &raquo;') . "' tabindex='2' />";
?>
</p>
<?php else : ?>
diff --git a/wp-inst/wp-admin/users.php b/wp-inst/wp-admin/users.php
index 43b4d3a..64b7662 100644
--- a/wp-inst/wp-admin/users.php
+++ b/wp-inst/wp-admin/users.php
@@ -365,7 +365,7 @@ $role_select .= '</select>';
</td>
</table>
<p class="submit">
- <input name="adduser" type="submit" id="adduser" value="<?php _e('Add User') ?> &raquo;" />
+ <input name="adduser" type="submit" id="adduser" value="<?php _e('Add User &raquo;') ?>" />
</p>
</form>
</div>
diff --git a/wp-inst/wp-comments-post.php b/wp-inst/wp-comments-post.php
index 5b1c0a2..e2ccba6 100644
--- a/wp-inst/wp-comments-post.php
+++ b/wp-inst/wp-comments-post.php
@@ -53,7 +53,7 @@ wp_new_comment( $commentdata );
if ( !$user_ID ) :
setcookie('comment_author_' . COOKIEHASH, stripslashes($comment_author), time() + 30000000, COOKIEPATH, COOKIE_DOMAIN);
setcookie('comment_author_email_' . COOKIEHASH, stripslashes($comment_author_email), time() + 30000000, COOKIEPATH, COOKIE_DOMAIN);
- setcookie('comment_author_url_' . COOKIEHASH, stripslashes($comment_author_url), time() + 30000000, COOKIEPATH, COOKIE_DOMAIN);
+ setcookie('comment_author_url_' . COOKIEHASH, stripslashes(clean_url($comment_author_url)), time() + 30000000, COOKIEPATH, COOKIE_DOMAIN);
endif;
$location = ( empty( $_POST['redirect_to'] ) ) ? get_permalink( $comment_post_ID ) : $_POST['redirect_to'];
diff --git a/wp-inst/wp-includes/comment-functions.php b/wp-inst/wp-includes/comment-functions.php
index efe4c95..a61610a 100644
--- a/wp-inst/wp-includes/comment-functions.php
+++ b/wp-inst/wp-includes/comment-functions.php
@@ -78,6 +78,8 @@ function wp_insert_comment($commentdata) {
$comment_parent = 0;
if ( ! isset($comment_approved) )
$comment_approved = 1;
+ if ( ! isset($user_id) )
+ $user_id = 0;
$result = $wpdb->query("INSERT INTO $wpdb->comments
(comment_post_ID, comment_author, comment_author_email, comment_author_url, comment_author_IP, comment_date, comment_date_gmt, comment_content, comment_approved, comment_agent, comment_type, comment_parent, user_id)
diff --git a/wp-inst/wp-includes/functions-post.php b/wp-inst/wp-includes/functions-post.php
index c3f9bd1..edebffb 100644
--- a/wp-inst/wp-includes/functions-post.php
+++ b/wp-inst/wp-includes/functions-post.php
@@ -312,6 +312,7 @@ function wp_insert_attachment($object, $file = false, $post_parent = 0) {
post_date = '$post_date',
post_date_gmt = '$post_date_gmt',
post_content = '$post_content',
+ post_content_filtered = '$post_content_filtered',
post_title = '$post_title',
post_excerpt = '$post_excerpt',
post_status = '$post_status',
@@ -332,9 +333,9 @@ function wp_insert_attachment($object, $file = false, $post_parent = 0) {
} else {
$wpdb->query(
"INSERT INTO $wpdb->posts
- (post_author, post_date, post_date_gmt, post_content, post_title, post_excerpt, post_status, post_type, comment_status, ping_status, post_password, post_name, to_ping, pinged, post_modified, post_modified_gmt, post_parent, menu_order, post_mime_type, guid)
+ (post_author, post_date, post_date_gmt, post_content, post_content_filtered, post_title, post_excerpt, post_status, post_type, comment_status, ping_status, post_password, post_name, to_ping, pinged, post_modified, post_modified_gmt, post_parent, menu_order, post_mime_type, guid)
VALUES
- ('$post_author', '$post_date', '$post_date_gmt', '$post_content', '$post_title', '$post_excerpt', '$post_status', '$post_type', '$comment_status', '$ping_status', '$post_password', '$post_name', '$to_ping', '$pinged', '$post_date', '$post_date_gmt', '$post_parent', '$menu_order', '$post_mime_type', '$guid')");
+ ('$post_author', '$post_date', '$post_date_gmt', '$post_content', '$post_content_filtered', '$post_title', '$post_excerpt', '$post_status', '$post_type', '$comment_status', '$ping_status', '$post_password', '$post_name', '$to_ping', '$pinged', '$post_date', '$post_date_gmt', '$post_parent', '$menu_order', '$post_mime_type', '$guid')");
$post_ID = $wpdb->insert_id;
}
diff --git a/wp-inst/wp-includes/functions.php b/wp-inst/wp-includes/functions.php
index b0bd13e..3d93ad8 100644
--- a/wp-inst/wp-includes/functions.php
+++ b/wp-inst/wp-includes/functions.php
@@ -681,7 +681,7 @@ function get_page_by_path($page_path) {
foreach($page_paths as $pathdir)
$full_path .= ($pathdir!=''?'/':'') . sanitize_title($pathdir);
- $pages = $wpdb->get_results("SELECT ID, post_name, post_parent FROM $wpdb->posts WHERE post_name = '$leaf_path'");
+ $pages = $wpdb->get_results("SELECT ID, post_name, post_parent FROM $wpdb->posts WHERE post_name = '$leaf_path' AND post_type='page'");
if ( empty($pages) )
return 0;
@@ -690,7 +690,7 @@ function get_page_by_path($page_path) {
$path = '/' . $leaf_path;
$curpage = $page;
while ($curpage->post_parent != 0) {
- $curpage = $wpdb->get_row("SELECT ID, post_name, post_parent FROM $wpdb->posts WHERE ID = '$curpage->post_parent'");
+ $curpage = $wpdb->get_row("SELECT ID, post_name, post_parent FROM $wpdb->posts WHERE ID = '$curpage->post_parent' and post_type='page'");
$path = '/' . $curpage->post_name . $path;
}
diff --git a/wp-inst/wp-includes/template-functions-category.php b/wp-inst/wp-includes/template-functions-category.php
index 001066e..1c9e4a2 100644
--- a/wp-inst/wp-includes/template-functions-category.php
+++ b/wp-inst/wp-includes/template-functions-category.php
@@ -48,7 +48,6 @@ function get_the_category_list($separator = '', $parents='') {
if ( '' == $separator ) {
$thelist .= '<ul class="post-categories">';
foreach ( $categories as $category ) {
- $category->cat_name = $category->cat_name;
$thelist .= "\n\t<li>";
switch ( strtolower($parents) ) {
case 'multiple':
@@ -71,7 +70,6 @@ function get_the_category_list($separator = '', $parents='') {
} else {
$i = 0;
foreach ( $categories as $category ) {
- $category->cat_name = $category->cat_name;
if ( 0 < $i )
$thelist .= $separator . ' ';
switch ( strtolower($parents) ) {
diff --git a/wp-inst/wp-includes/template-functions-links.php b/wp-inst/wp-includes/template-functions-links.php
index 210d5ed..28262f3 100644
--- a/wp-inst/wp-includes/template-functions-links.php
+++ b/wp-inst/wp-includes/template-functions-links.php
@@ -62,14 +62,15 @@ function get_permalink($id = 0) {
$authordata = get_userdata($post->post_author);
$author = $authordata->user_nicename;
+ $date = explode(" ",date('Y m d H i s', $unixtime));
$rewritereplace =
array(
- date('Y', $unixtime),
- date('m', $unixtime),
- date('d', $unixtime),
- date('H', $unixtime),
- date('i', $unixtime),
- date('s', $unixtime),
+ $date[0],
+ $date[1],
+ $date[2],
+ $date[3],
+ $date[4],
+ $date[5],
$post->post_name,
$post->ID,
$category,
diff --git a/wp-inst/wp-login.php b/wp-inst/wp-login.php
index da4a814..f4a2fa4 100644
--- a/wp-inst/wp-login.php
+++ b/wp-inst/wp-login.php
@@ -73,7 +73,7 @@ if ($error)
<p><label><?php _e('E-mail:') ?><br />
<input type="text" name="email" id="email" value="" size="25" tabindex="2" /></label><br />
</p>
-<p class="submit"><input type="submit" name="submit" id="submit" value="<?php _e('Retrieve Password'); ?> &raquo;" tabindex="3" /></p>
+<p class="submit"><input type="submit" name="submit" id="submit" value="<?php _e('Retrieve Password &raquo;'); ?>" tabindex="3" /></p>
</form>
<ul>
<li><a href="<?php bloginfo('home'); ?>/" title="<?php _e('Are you lost?') ?>">&laquo; <?php _e('Back to blog') ?></a></li>
diff --git a/wp-inst/wp-register.php b/wp-inst/wp-register.php
index 28aa5f2..e0c6c04 100644
--- a/wp-inst/wp-register.php
+++ b/wp-inst/wp-register.php
@@ -68,7 +68,7 @@ case 'register':
<p><?php printf(__('Username: %s'), "<strong>$user_login</strong>") ?><br />
<?php printf(__('Password: %s'), '<strong>' . __('emailed to you') . '</strong>') ?> <br />
<?php printf(__('E-mail: %s'), "<strong>$user_email</strong>") ?></p>
- <p class="submit"><a href="wp-login.php"><?php _e('Login'); ?> &raquo;</a></p>
+ <p class="submit"><a href="wp-login.php"><?php _e('Login &raquo;'); ?></a></p>
</div>
</body>
</html>
@@ -111,7 +111,7 @@ default:
<label for="user_login"><?php _e('Username:') ?></label><br /> <input type="text" name="user_login" id="user_login" size="20" maxlength="20" value="<?php echo $user_login; ?>" /><br /></p>
<p><label for="user_email"><?php _e('E-mail:') ?></label><br /> <input type="text" name="user_email" id="user_email" size="25" maxlength="100" value="<?php echo $user_email; ?>" /></p>
<p><?php _e('A password will be emailed to you.') ?></p>
- <p class="submit"><input type="submit" value="<?php _e('Register') ?> &raquo;" id="submit" name="submit" /></p>
+ <p class="submit"><input type="submit" value="<?php _e('Register &raquo;') ?>" id="submit" name="submit" /></p>
</form>
<ul>
<li><a href="<?php bloginfo('home'); ?>/" title="<?php _e('Are you lost?') ?>">&laquo; <?php _e('Back to blog') ?></a></li>