WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/20/2015 04:04:26 AM (6 years ago)
Author:
wonderboymusic
Message:

Formatting: when making unique filenames in wp_unique_filename() by adding an incrementing number, prefix it with a dash to disambiguate from files that end in numbers.

Updates unit tests.

Props mikejolley, tyxla.
Fixes #21453.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/functions.php

    r35242 r35276  
    147147        // check number is appended for file already exists
    148148        $this->assertFileExists( $testdir . 'test-image.png', 'Test image does not exist' );
    149         $this->assertEquals( 'test-image1.png', wp_unique_filename( $testdir, 'test-image.png' ), 'Number not appended correctly' );
    150         $this->assertFileNotExists( $testdir . 'test-image1.png' );
     149        $this->assertEquals( 'test-image-1.png', wp_unique_filename( $testdir, 'test-image.png' ), 'Number not appended correctly' );
     150        $this->assertFileNotExists( $testdir . 'test-image-1.png' );
    151151
    152152        // check special chars
Note: See TracChangeset for help on using the changeset viewer.