Development

#2958 (Mistake in forming lists of relative paths.)

You must first sign up to be able to contribute.

Ticket #2958 (closed defect: fixed)

Opened 10 months ago

Last modified 8 months ago

Mistake in forming lists of relative paths.

Reported by: infopulse_ukraine Assigned to: fabien
Priority: major Milestone: 1.0.14
Component: controller Version: 1.0.11
Keywords: sfFinder, core, util Cc:
Qualification: Unreviewed

Description

File: PEAR/symony/utils/sfFinder.class.php Line: 342.

$files = array_merge($files, str_replace($dir.DIRECTORY_SEPARATOR, '', $this->search_in($dir)));

Unnecessary DIRECTORY_SEPARATOR in code above brings wrong processing of str_replace(...). As result instead of relative paths to files forms array of absolute paths.

Platform: MS Windows, Apache 2.2.8, PHP 5.2.5

Solution: Line 342.

$files = array_merge($files, str_replace($dir, '', $this->search_in($dir)));

Change History

(in reply to: ↑ description ) 02/18/08 17:02:47 changed by infopulse_ukraine

This class make errors in sfMediaLibrary plugin: File: plugins/sfMediaLibraryPlugin/modules/sfMediaLibrary/lib/BasesfMediaLibraryActions.class.php Line: 59

    $files = sfFinder::type('file')->maxdepth(0)->prune('.*')->discard('.*')->relative()->in($this->absCurrentDir);

04/04/08 10:16:09 changed by noel

  • status changed from new to closed.
  • resolution set to fixed.

(In [8254]) fixed #2958, #2416, #3110 : relative file search with sfFinder (closes #3110)

04/04/08 11:14:27 changed by noel

  • milestone set to 1.0.14.