summaryrefslogtreecommitdiffstats
path: root/wp-admin/includes/media.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-04-25 09:03:55 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-04-25 09:03:55 +0000
commit4dbe26b26fe556c71cc38e2531110bc63f351b4d (patch)
treede454a939b6567f1eef16952ff4ba883548eb498 /wp-admin/includes/media.php
parentbc31549fc8053f8bc6502c337707168d5e66c508 (diff)
downloadwordpress-mu-4dbe26b26fe556c71cc38e2531110bc63f351b4d.tar.gz
wordpress-mu-4dbe26b26fe556c71cc38e2531110bc63f351b4d.tar.xz
wordpress-mu-4dbe26b26fe556c71cc38e2531110bc63f351b4d.zip
WP Merge to revision 7826
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1266 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-admin/includes/media.php')
-rw-r--r--wp-admin/includes/media.php52
1 files changed, 26 insertions, 26 deletions
diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php
index 6b28c96..1000d15 100644
--- a/wp-admin/includes/media.php
+++ b/wp-admin/includes/media.php
@@ -632,7 +632,7 @@ function get_media_item( $attachment_id, $args = null ) {
if ( isset($post_mime_types) ) {
$keys = array_keys(wp_match_mime_types(array_keys($post_mime_types), $post->post_mime_type));
$type = array_shift($keys);
- $type = "<input type='hidden' id='type-of-$attachment_id' value='$type' />";
+ $type = "<input type='hidden' id='type-of-$attachment_id' value='" . attribute_escape( $type ) . "' />";
}
$form_fields = get_attachment_fields_to_edit($post, $errors);
@@ -674,7 +674,7 @@ function get_media_item( $attachment_id, $args = null ) {
$delete_href = wp_nonce_url("post.php?action=delete-post&amp;post=$attachment_id", 'delete-post_' . $attachment_id);
if ( $send )
- $send = "<input type='submit' class='button' name='send[$attachment_id]' value='" . __('Insert into Post') . "' />";
+ $send = "<input type='submit' class='button' name='send[$attachment_id]' value='" . attribute_escape( __( 'Insert into Post' ) ) . "' />";
if ( $delete )
$delete = "<a href='$delete_href' id='del[$attachment_id]' disabled='disabled' class='delete'>" . __('Delete') . "</button>";
if ( ( $send || $delete ) && !isset($form_fields['buttons']) )
@@ -707,9 +707,9 @@ function get_media_item( $attachment_id, $args = null ) {
if ( !empty($field[$field['input']]) )
$item .= $field[$field['input']];
elseif ( $field['input'] == 'textarea' ) {
- $item .= "<textarea type='text' id='$name' name='$name'>" . wp_specialchars($field['value'], 1) . "</textarea>";
+ $item .= "<textarea type='text' id='$name' name='$name'>" . attribute_escape( $field['value'] ) . "</textarea>";
} else {
- $item .= "<input type='text' id='$name' name='$name' value='" . wp_specialchars($field['value'], 1) . "' />";
+ $item .= "<input type='text' id='$name' name='$name' value='" . attribute_escape( $field['value'] ) . "' />";
}
if ( !empty($field['helps']) )
$item .= "<p class='help'>" . join( "</p>\n<p class='help'>", array_unique((array) $field['helps']) ) . '</p>';
@@ -737,7 +737,7 @@ function get_media_item( $attachment_id, $args = null ) {
$item .= "\t</table>\n";
foreach ( $hidden_fields as $name => $value )
- $item .= "\t<input type='hidden' name='$name' id='$name' value='" . wp_specialchars($value, 1) . "' />\n";
+ $item .= "\t<input type='hidden' name='$name' id='$name' value='" . attribute_escape( $value ) . "' />\n";
return $item;
}
@@ -765,7 +765,7 @@ function media_upload_form( $errors = null ) {
$post_id = intval($_REQUEST['post_id']);
?>
-<input type='hidden' name='post_id' value='<?php echo $post_id; ?>' />
+<input type='hidden' name='post_id' value='<?php echo (int) $post_id; ?>' />
<div id="media-upload-notice">
<?php if (isset($errors['upload_notice']) ) { ?>
<?php echo $errors['upload_notice']; ?>
@@ -814,7 +814,7 @@ jQuery(function($){
<div id="flash-upload-ui">
- <p><input id="flash-browse-button" type="button" value="<?php _e('Choose files to upload'); ?>" class="button" /></p>
+ <p><input id="flash-browse-button" type="button" value="<?php echo attribute_escape( __( 'Choose files to upload' ) ); ?>" class="button" /></p>
<p><?php _e('After a file has been uploaded, you can add titles and descriptions.'); ?></p>
</div>
@@ -824,7 +824,7 @@ jQuery(function($){
<p>
<input type="file" name="async-upload" id="async-upload" /> <input type="submit" class="button" name="html-upload" value="<?php echo attribute_escape(__('Upload')); ?>" /> <a href="#" onClick="return top.tb_remove();"><?php _e('Cancel'); ?></a>
</p>
- <input type="hidden" name="post_id" id="post_id" value="<?php echo $post_id; ?>" />
+ <input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
<br class="clear" />
<?php if ( is_lighttpd_before_150() ): ?>
<p><?php _e('If you want to use all capabilities of the uploader, like uploading multiple files at once, please upgrade to lighttpd 1.5.'); ?></p>
@@ -844,7 +844,7 @@ function media_upload_type_form($type = 'file', $errors = null, $id = null) {
?>
<form enctype="multipart/form-data" method="post" action="<?php echo attribute_escape($form_action_url); ?>" class="media-upload-form type-form validate" id="<?php echo $type; ?>-form">
-<input type="hidden" name="post_id" id="post_id" value="<?php echo $post_id; ?>" />
+<input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
<?php wp_nonce_field('media-form'); ?>
<h3><?php _e('From Computer'); ?></h3>
<?php media_upload_form( $errors ); ?>
@@ -864,7 +864,7 @@ jQuery(function($){
<div id="media-items">
<?php echo get_media_items( $id, $errors ); ?>
</div>
-<input type="submit" class="button savebutton" name="save" value="<?php _e('Save all changes'); ?>" />
+<input type="submit" class="button savebutton" name="save" value="<?php echo attribute_escape( __( 'Save all changes' ) ); ?>" />
<?php elseif ( is_callable($callback) ) : ?>
@@ -878,7 +878,7 @@ jQuery(function($){
<?php echo call_user_func($callback); ?>
</div>
</div>
-<input type="submit" class="button savebutton" name="save" value="<?php _e('Save all changes'); ?>" />
+<input type="submit" class="button savebutton" name="save" value="<?php echo attribute_escape( __( 'Save all changes' ) ); ?>" />
<?php
endif;
}
@@ -911,11 +911,11 @@ jQuery(function($){
<div id="media-items">
<?php echo get_media_items($post_id, $errors); ?>
</div>
-<input type="submit" class="button savebutton" name="save" value="<?php _e('Save all changes'); ?>" />
-<input type="submit" class="button insert-gallery" name="insert-gallery" value="<?php _e('Insert gallery into post'); ?>" />
-<input type="hidden" name="post_id" id="post_id" value="<?php echo $post_id; ?>" />
-<input type="hidden" name="type" value="<?php echo $GLOBALS['type']; ?>" />
-<input type="hidden" name="tab" value="<?php echo $GLOBALS['tab']; ?>" />
+<input type="submit" class="button savebutton" name="save" value="<?php echo attribute_escape( __( 'Save all changes' ) ); ?>" />
+<input type="submit" class="button insert-gallery" name="insert-gallery" value="<?php echo attribute_escape( __( 'Insert gallery into post' ) ); ?>" />
+<input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
+<input type="hidden" name="type" value="<?php echo attribute_escape( $GLOBALS['type'] ); ?>" />
+<input type="hidden" name="tab" value="<?php echo attribute_escape( $GLOBALS['tab'] ); ?>" />
</form>
<?php
}
@@ -942,14 +942,14 @@ function media_upload_library_form($errors) {
?>
<form id="filter" action="" method="get">
-<input type="hidden" name="type" value="<?php echo $type; ?>" />
-<input type="hidden" name="tab" value="<?php echo $tab; ?>" />
-<input type="hidden" name="post_id" value="<?php echo $post_id; ?>" />
-<input type="hidden" name="post_mime_type" value="<?php echo wp_specialchars($_GET['post_mime_type'], true); ?>" />
+<input type="hidden" name="type" value="<?php echo attribute_escape( $type ); ?>" />
+<input type="hidden" name="tab" value="<?php echo attribute_escape( $tab ); ?>" />
+<input type="hidden" name="post_id" value="<?php echo (int) $post_id; ?>" />
+<input type="hidden" name="post_mime_type" value="<?php echo attribute_escape( $_GET['post_mime_type'] ); ?>" />
<div id="search-filter">
<input type="text" id="post-search-input" name="s" value="<?php the_search_query(); ?>" />
- <input type="submit" value="<?php _e( 'Search Media' ); ?>" class="button" />
+ <input type="submit" value="<?php echo attribute_escape( __( 'Search Media' ) ); ?>" class="button" />
</div>
<p>
@@ -1023,15 +1023,15 @@ foreach ($arc_result as $arc_row) {
else
$default = '';
- echo "<option$default value='$arc_row->yyear$arc_row->mmonth'>";
- echo $wp_locale->get_month($arc_row->mmonth) . " $arc_row->yyear";
+ echo "<option$default value='" . attribute_escape( $arc_row->yyear . $arc_row->mmonth ) . "'>";
+ echo wp_specialchars( $wp_locale->get_month($arc_row->mmonth) . " $arc_row->yyear" );
echo "</option>\n";
}
?>
</select>
<?php } ?>
-<input type="submit" id="post-query-submit" value="<?php _e('Filter &#187;'); ?>" class="button-secondary" />
+<input type="submit" id="post-query-submit" value="<?php echo attribute_escape( __( 'Filter &#187;' ) ); ?>" class="button-secondary" />
</div>
@@ -1059,8 +1059,8 @@ jQuery(function($){
<div id="media-items">
<?php echo get_media_items(null, $errors); ?>
</div>
-<input type="submit" class="button savebutton" name="save" value="<?php _e('Save all changes'); ?>" />
-<input type="hidden" name="post_id" id="post_id" value="<?php echo $post_id; ?>" />
+<input type="submit" class="button savebutton" name="save" value="<?php echo attribute_escape( __( 'Save all changes' ) ); ?>" />
+<input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
</form>
<?php
}