Zend Framework

Zend_Filter_RealPath to support non-existing paths

Details

  • Type: Improvement Improvement
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 0.9.2
  • Fix Version/s: 1.8.0
  • Component/s: Zend_Filter
  • Labels:
    None
  • Fix Version Priority:
    Should Have

Description

I would like to suggest to add an enhancement to the current Zend_Filter_RealPath filter. PHP's function realpath will give you the absolute path from the provided path, however this does not work when a path does not exist. Realpath would then return false.

Allowing calculation of realpath() results when the input path does not exist, would be a good enhancement for the current implementation.

However, the developer should be able to turn this feature on/off, as I can imagine the need of having false returned when the path does not exist.

Activity

Hide
Andries Seutens added a comment -

Assigned to Andries Seutens.

Show
Andries Seutens added a comment - Assigned to Andries Seutens.
Hide
Darby Felton added a comment -

Update to summary and affects version 0.9.2.

Show
Darby Felton added a comment - Update to summary and affects version 0.9.2.
Hide
Andries Seutens added a comment -

There is working code available at http://andries.systray.be/RealPath.phps

Show
Andries Seutens added a comment - There is working code available at http://andries.systray.be/RealPath.phps
Hide
Andries Seutens added a comment -
Show
Andries Seutens added a comment - And unit tests: http://andries.systray.be/RealPathTest.phps
Hide
Andries Seutens added a comment -

We have not agreed yet how to turn the feature on/off. I personally would prefer havinig a public property which could be set to true (default) or false.

Another idea is to have a public method {{allowVirtualPath(true)... }}

Show
Andries Seutens added a comment - We have not agreed yet how to turn the feature on/off. I personally would prefer havinig a public property which could be set to true (default) or false. Another idea is to have a public method {{allowVirtualPath(true)... }}
Hide
Andries Seutens added a comment -

Updated priority from critical to minor.

Show
Andries Seutens added a comment - Updated priority from critical to minor.
Hide
Thomas Weidner added a comment -

Andries:
Please give code or a description on how this should be done.
Actually I see problems if the complete path does not exist.

When there is no response I will close this issue as won't fix as there are wether votes nor watchers on it.

Show
Thomas Weidner added a comment - Andries: Please give code or a description on how this should be done. Actually I see problems if the complete path does not exist. When there is no response I will close this issue as won't fix as there are wether votes nor watchers on it.
Hide
Nils Caspar added a comment -

I re-uploaded Andries' code: http://pastie.org/458077

Show
Nils Caspar added a comment - I re-uploaded Andries' code: http://pastie.org/458077
Hide
Thomas Weidner added a comment -

New feature added with r15153

Show
Thomas Weidner added a comment - New feature added with r15153

People

Vote (1)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: