4091_getUnixStylePath_creates_invalid_paths_on_windows.patch

Bastian Waidelich, 2009-08-03 17:52

Download (1.12 KB)

View differences:

Classes/Utility/Files.php (working copy)
39 39
	 * @author Malte Jansen <typo3@maltejansen.de>
40 40
	 */
41 41
	public static function getUnixStylePath($path) {
42
		return str_replace(':/', '://', str_replace('//', '/', str_replace('\\', '/', $path)));
42
		return str_replace('\\', '/', $path);
43 43
	}
44 44

  
45 45
	/**
Tests/Utility/FilesTest.php (working copy)
70 70
	 * @test
71 71
	 * @author Bastian Waidelich <bastian@typo3.org>
72 72
	 */
73
	public function getUnixStylePathKeepsDoubleSlashes() {
74
		$path = 'vfs://foo\bar';
75
		$this->assertEquals('vfs://foo/bar', \F3\FLOW3\Utility\Files::getUnixStylePath($path));
76
	}
77

  
78
	/**
79
	 * @test
80
	 * @author Bastian Waidelich <bastian@typo3.org>
81
	 */
73 82
	public function concatenatePathsWorksForEmptyPath() {
74 83
		$this->assertEquals('', \F3\FLOW3\Utility\Files::concatenatePaths(array()));
75 84
	}