Skip to content

Commit

Permalink
Merge pull request #145 from samayo/bugfix/setName-not-setting-image-…
Browse files Browse the repository at this point in the history
…name

fix image name setter not workin #141
  • Loading branch information
samayo authored May 5, 2024
2 parents d235db2 + 5a65c99 commit d298067
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/bulletproof.php
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,11 @@ public function setStorage($dir = 'uploads', $permission = 0666)
*/
protected function constraintValidator()
{
// handle naming of file
$this->setName();

// if name is provided use it, otherwise generate a unique name
if (!$this->name) {
$this->setName();
}

/* check image for valid mime types and return mime */
$this->getImageMime($this->_files['tmp_name']);
Expand Down

0 comments on commit d298067

Please sign in to comment.