Doctrine 1
  1. Doctrine 1
  2. DC-89

Doctrine_Table::setColumn() "... as ..." parsing code typo.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 1.2.0-ALPHA1
    • Fix Version/s: 1.0.13, 1.1.5, 1.2.0-ALPHA3
    • Component/s: Record
    • Labels:
      None

      Description

      From the setColumn() function in Doctrine_Table:

              // extract column name & field name
              if (stripos($name, ' as '))
              {
                  if (strpos($name, ' as')) {
                      $parts = explode(' as ', $name);
                  } else {
                      $parts = explode(' AS ', $name);
                  }
      

      Because strpos($name, ' as') is missing a space after "as", there is a (I admin, quite rare case that this might fail, namely a case like "ArchiveStatus AS as". This would match the case sensitive ' as' check and it would then split on ' as ', resulting in breakage.

        Activity

        There are no comments yet on this issue.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: