diff options
| author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-06-21 16:41:02 +0000 |
|---|---|---|
| committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-06-21 16:41:02 +0000 |
| commit | a5fe68e002632c190ffbd85167671ed4d4961135 (patch) | |
| tree | ae57f94603111507c50cb3c212a03bedf8f7dc5a /wp-admin/edit-form-advanced.php | |
| parent | 4e38776b5b68c61a4593a84340f4654200f7568e (diff) | |
| download | wordpress-mu-a5fe68e002632c190ffbd85167671ed4d4961135.tar.gz wordpress-mu-a5fe68e002632c190ffbd85167671ed4d4961135.tar.xz wordpress-mu-a5fe68e002632c190ffbd85167671ed4d4961135.zip | |
WP Merge to WP 2.2.1
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1005 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-admin/edit-form-advanced.php')
| -rw-r--r-- | wp-admin/edit-form-advanced.php | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index b934ed8..81a998b 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -1,10 +1,12 @@ <?php +if ( isset($_GET['message']) ) + $_GET['message'] = (int) $_GET['message']; $messages[1] = __('Post updated'); $messages[2] = __('Custom field updated'); $messages[3] = __('Custom field deleted.'); ?> <?php if (isset($_GET['message'])) : ?> -<div id="message" class="updated fade"><p><?php echo $messages[$_GET['message']]; ?></p></div> +<div id="message" class="updated fade"><p><?php echo wp_specialchars($messages[$_GET['message']]); ?></p></div> <?php endif; ?> <form name="post" action="post.php" method="post" id="post"> @@ -21,16 +23,17 @@ if (0 == $post_ID) { $form_extra = "<input type='hidden' id='post_ID' name='temp_ID' value='$temp_ID' />"; wp_nonce_field('add-post'); } else { + $post_ID = (int) $post_ID; $form_action = 'editpost'; $form_extra = "<input type='hidden' id='post_ID' name='post_ID' value='$post_ID' />"; wp_nonce_field('update-post_' . $post_ID); } -$form_pingback = '<input type="hidden" name="post_pingback" value="' . get_option('default_pingback_flag') . '" id="post_pingback" />'; +$form_pingback = '<input type="hidden" name="post_pingback" value="' . (int) get_option('default_pingback_flag') . '" id="post_pingback" />'; -$form_prevstatus = '<input type="hidden" name="prev_status" value="' . $post->post_status . '" />'; +$form_prevstatus = '<input type="hidden" name="prev_status" value="' . attribute_escape( $post->post_status ) . '" />'; -$form_trackback = '<input type="text" name="trackback_url" style="width: 415px" id="trackback" tabindex="7" value="'. str_replace("\n", ' ', $post->to_ping) .'" />'; +$form_trackback = '<input type="text" name="trackback_url" style="width: 415px" id="trackback" tabindex="7" value="'. attribute_escape( str_replace("\n", ' ', $post->to_ping) ) .'" />'; if ('' != $post->pinged) { $pings = '<p>'. __('Already pinged:') . '</p><ul>'; @@ -41,16 +44,16 @@ if ('' != $post->pinged) { $pings .= '</ul>'; } -$saveasdraft = '<input name="save" type="submit" id="save" tabindex="3" value="' . __('Save and Continue Editing') . '" />'; +$saveasdraft = '<input name="save" type="submit" id="save" tabindex="3" value="' . attribute_escape( __('Save and Continue Editing') ) . '" />'; if (empty($post->post_status)) $post->post_status = 'draft'; ?> -<input type="hidden" name="user_ID" value="<?php echo $user_ID ?>" /> +<input type="hidden" name="user_ID" value="<?php echo (int) $user_ID ?>" /> <input type="hidden" id="hiddenaction" name="action" value="<?php echo $form_action ?>" /> <input type="hidden" id="originalaction" name="originalaction" value="<?php echo $form_action ?>" /> -<input type="hidden" name="post_author" value="<?php echo $post->post_author ?>" /> +<input type="hidden" name="post_author" value="<?php echo attribute_escape( $post->post_author ); ?>" /> <input type="hidden" id="post_type" name="post_type" value="post" /> <?php echo $form_extra ?> @@ -88,12 +91,12 @@ addLoadEvent(focusit); <fieldset id="passworddiv" class="dbx-box"> <h3 class="dbx-handle"><?php _e('Post Password') ?></h3> -<div class="dbx-content"><input name="post_password" type="text" size="13" id="post_password" value="<?php echo $post->post_password ?>" /></div> +<div class="dbx-content"><input name="post_password" type="text" size="13" id="post_password" value="<?php echo attribute_escape( $post->post_password ); ?>" /></div> </fieldset> <fieldset id="slugdiv" class="dbx-box"> <h3 class="dbx-handle"><?php _e('Post Slug') ?></h3> -<div class="dbx-content"><input name="post_name" type="text" size="13" id="post_name" value="<?php echo $post->post_name ?>" /></div> +<div class="dbx-content"><input name="post_name" type="text" size="13" id="post_name" value="<?php echo attribute_escape( $post->post_name ); ?>" /></div> </fieldset> <fieldset id="poststatusdiv" class="dbx-box"> @@ -125,7 +128,7 @@ foreach ($authors as $o) : $o = get_userdata( $o->ID ); if ( $post->post_author == $o->ID || ( empty($post_ID) && $user_ID == $o->ID ) ) $selected = 'selected="selected"'; else $selected = ''; -echo "<option value='$o->ID' $selected>$o->display_name</option>"; +echo "<option value='" . (int) $o->ID . "' $selected>" . wp_specialchars( $o->display_name ) . "</option>"; endforeach; ?> </select> @@ -140,7 +143,7 @@ endforeach; <fieldset id="titlediv"> <legend><?php _e('Title') ?></legend> - <div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo $post->post_title; ?>" id="title" /></div> + <div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo attribute_escape($post->post_title); ?>" id="title" /></div> </fieldset> <fieldset id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>"> @@ -168,7 +171,7 @@ endforeach; if ('publish' != $post->post_status || 0 == $post_ID) { ?> <?php if ( current_user_can('publish_posts') ) : ?> - <input name="publish" type="submit" id="publish" tabindex="5" accesskey="p" value="<?php _e('Publish') ?>" /> + <input name="publish" type="submit" id="publish" tabindex="5" accesskey="p" value="<?php _e('Publish'); ?>" /> <?php endif; ?> <?php } @@ -186,11 +189,11 @@ else <?php if (current_user_can('upload_files')) { - $uploading_iframe_ID = (0 == $post_ID ? $temp_ID : $post_ID); + $uploading_iframe_ID = (int) (0 == $post_ID ? $temp_ID : $post_ID); $uploading_iframe_src = wp_nonce_url("upload.php?style=inline&tab=upload&post_id=$uploading_iframe_ID", 'inlineuploading'); $uploading_iframe_src = apply_filters('uploading_iframe_src', $uploading_iframe_src); if ( false != $uploading_iframe_src ) - echo '<iframe id="uploading" name="uploading" frameborder="0" src="' . $uploading_iframe_src . '">' . __('This feature requires iframe support.') . '</iframe>'; + echo '<iframe id="uploading" frameborder="0" src="' . $uploading_iframe_src . '">' . __('This feature requires iframe support.') . '</iframe>'; } ?> |
