Development

Changeset 8535

You must first sign up to be able to contribute.

Changeset 8535

Show
Ignore:
Timestamp:
04/18/08 19:42:22 (1 year ago)
Author:
fabien
Message:

fixed file upload when used with a Propel form (added functional tests)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.1/lib/plugins/sfPropelPlugin/test/functional/fixtures/config/schema.xml

    r8296 r8535  
    5959  </table> 
    6060 
     61  <table name="attachment"> 
     62    <column name="id" type="integer" required="true" primaryKey="true" autoincrement="true" /> 
     63    <column name="name" type="varchar" size="255" /> 
     64    <column name="file" type="varchar" size="255" /> 
     65  </table> 
     66 
    6167</database> 
  • branches/1.1/lib/validator/sfValidatorFile.class.php

    r8525 r8535  
    312312 
    313313  /** 
     314   * Returns the name of the saved file. 
     315   */ 
     316  public function __toString() 
     317  { 
     318    return $this->savedName; 
     319  } 
     320 
     321  /** 
    314322   * Saves the uploaded file. 
    315323   * 
     
    386394  public function getOriginalExtension($default = '') 
    387395  { 
    388     return (false === $pos = strpos($this->getOriginalName(), '.')) ? $default : substr($this->getOriginalName(), $pos); 
     396    return (false === $pos = strrpos($this->getOriginalName(), '.')) ? $default : substr($this->getOriginalName(), $pos); 
    389397  } 
    390398 

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting, and supporting several large Open-Source projects.