Skip to content
Browse files

added strval to array values in String::substitute

file validator bug with "file" instead of "File"
  • Loading branch information...
1 parent d68636d commit d3744ba0f29cb7e1d32f26c9a77d6e41c0ab2ebe @Ephigenia committed May 2, 2012
Showing with 2 additions and 1 deletion.
  1. +1 −0 lib/ephFrame/util/String.php
  2. +1 −1 lib/ephFrame/validator/File.php
View
1 lib/ephFrame/util/String.php
@@ -182,6 +182,7 @@ public static function substitute($template, $arr = array())
if (strlen($a) > strlen($b)) return -1;
return 1;
});
+ $arr = array_map('strval', $arr);
foreach($arr as $key => $value) {
$result = preg_replace('@:'.preg_quote($key, '@').'@', $value, $result);
}
View
2 lib/ephFrame/validator/File.php
@@ -53,7 +53,7 @@ public function validateSize(\ephFrame\File\UploadedFile $File)
public function validateMimeType(\ephFrame\File\UploadedFile $File)
{
- if (!empty($this->mimeTypes) && !in_array($file->mimeType(), $this->mimeTypes)) {
+ if (!empty($this->mimeTypes) && !in_array($File->mimeType(), $this->mimeTypes)) {
$this->mimeType = $File->mimeType();
$this->types = implode(', ', $this->mimeTypes);
$this->message = $this->messages['MIMETYPE'];

0 comments on commit d3744ba

Please sign in to comment.
Something went wrong with that request. Please try again.