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:
parent
a15cb1971e
commit
5a529cd216
|
@ -14,7 +14,8 @@ require_once('includes/export.php');
|
||||||
$title = __('Export');
|
$title = __('Export');
|
||||||
|
|
||||||
if ( isset( $_GET['download'] ) ) {
|
if ( isset( $_GET['download'] ) ) {
|
||||||
export_wp( $_GET['author'] );
|
$author = isset($_GET['author']) ? $_GET['author'] : 'all';
|
||||||
|
export_wp( $author );
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -339,7 +339,6 @@ class WP_Import {
|
||||||
}
|
}
|
||||||
|
|
||||||
function process_posts() {
|
function process_posts() {
|
||||||
$i = -1;
|
|
||||||
echo '<ol>';
|
echo '<ol>';
|
||||||
|
|
||||||
$this->get_entries(array(&$this, 'process_post'));
|
$this->get_entries(array(&$this, 'process_post'));
|
||||||
|
|
|
@ -1893,7 +1893,7 @@ function wp_unique_filename( $dir, $filename, $unique_filename_callback = null )
|
||||||
$filename = strtolower( $filename );
|
$filename = strtolower( $filename );
|
||||||
// separate the filename into a name and extension
|
// separate the filename into a name and extension
|
||||||
$info = pathinfo($filename);
|
$info = pathinfo($filename);
|
||||||
$ext = $info['extension'];
|
$ext = !empty($info['extension']) ? $info['extension'] : '';
|
||||||
$name = basename($filename, ".{$ext}");
|
$name = basename($filename, ".{$ext}");
|
||||||
|
|
||||||
// edge case: if file is named '.ext', treat as an empty name
|
// 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 {
|
} else {
|
||||||
$number = '';
|
$number = '';
|
||||||
|
|
||||||
if ( empty( $ext ) )
|
if ( !empty( $ext ) )
|
||||||
$ext = '';
|
|
||||||
else
|
|
||||||
$ext = strtolower( ".$ext" );
|
$ext = strtolower( ".$ext" );
|
||||||
|
|
||||||
$filename = str_replace( $ext, '', $filename );
|
$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 ) {
|
function wp_upload_bits( $name, $deprecated, $bits, $time = null ) {
|
||||||
if ( empty( $name ) )
|
if ( empty( $name ) )
|
||||||
return array( 'error' => __( "Empty filename" ) );
|
return array( 'error' => __( 'Empty filename' ) );
|
||||||
|
|
||||||
$wp_filetype = wp_check_filetype( $name );
|
$wp_filetype = wp_check_filetype( $name );
|
||||||
if ( !$wp_filetype['ext'] )
|
if ( !$wp_filetype['ext'] )
|
||||||
return array( 'error' => __( "Invalid file type" ) );
|
return array( 'error' => __( 'Invalid file type' ) );
|
||||||
|
|
||||||
$upload = wp_upload_dir( $time );
|
$upload = wp_upload_dir( $time );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue