Doctrine 1
  1. Doctrine 1
  2. DC-235

wrong strpos() check in Doctrine_Cache_Driver::deleteByPrefix()

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.0-BETA2
    • Fix Version/s: 1.2.0-BETA3
    • Component/s: Caching
    • Labels:
      None

      Description

      In Doctrine_Cache_Driver::::deleteByPrefix() on line 216 you can read:

      if (strpos($key, $prefix) == 0) ...

      to check whether the prefix starts on the first position.
      As strpos() returns false if the prefix is not found at all and 0 evaluates to false this results to the deletion of unnecessary cache keys.

      correct would be:

      if (strpos($key, $prefix) === 0) ... // triple '='

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Christian Schaefer
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: