Notice fixes from DD32. see #7509

git-svn-id: http://svn.automattic.com/wordpress/trunk@9270 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-10-21 23:54:18 +00:00
parent a15cb1971e
commit 5a529cd216
3 changed files with 6 additions and 8 deletions

View File

@ -14,7 +14,8 @@ require_once('includes/export.php');
$title = __('Export');
if ( isset( $_GET['download'] ) ) {
export_wp( $_GET['author'] );
$author = isset($_GET['author']) ? $_GET['author'] : 'all';
export_wp( $author );
die();
}

View File

@ -339,7 +339,6 @@ class WP_Import {
}
function process_posts() {
$i = -1;
echo '<ol>';
$this->get_entries(array(&$this, 'process_post'));

View File

@ -1893,7 +1893,7 @@ function wp_unique_filename( $dir, $filename, $unique_filename_callback = null )
$filename = strtolower( $filename );
// separate the filename into a name and extension
$info = pathinfo($filename);
$ext = $info['extension'];
$ext = !empty($info['extension']) ? $info['extension'] : '';
$name = basename($filename, ".{$ext}");
// edge case: if file is named '.ext', treat as an empty name
@ -1906,9 +1906,7 @@ function wp_unique_filename( $dir, $filename, $unique_filename_callback = null )
} else {
$number = '';
if ( empty( $ext ) )
$ext = '';
else
if ( !empty( $ext ) )
$ext = strtolower( ".$ext" );
$filename = str_replace( $ext, '', $filename );
@ -1951,11 +1949,11 @@ function wp_unique_filename( $dir, $filename, $unique_filename_callback = null )
*/
function wp_upload_bits( $name, $deprecated, $bits, $time = null ) {
if ( empty( $name ) )
return array( 'error' => __( "Empty filename" ) );
return array( 'error' => __( 'Empty filename' ) );
$wp_filetype = wp_check_filetype( $name );
if ( !$wp_filetype['ext'] )
return array( 'error' => __( "Invalid file type" ) );
return array( 'error' => __( 'Invalid file type' ) );
$upload = wp_upload_dir( $time );