浏览代码

[ProfilerController] Fix handling of uploaded files

Victor Berchet 14 年之前
父节点
当前提交
89433fbcfe
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php

+ 2 - 2
src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php

@@ -106,11 +106,11 @@ class ProfilerController extends ContainerAware
         $profiler->disable();
 
         $file = $this->container->get('request')->files->get('file');
-        if (!$file || 0 !== $file['error']) {
+        if (!$file || UPLOAD_ERR_OK !== $file->getError()) {
             throw new \RuntimeException('Problem uploading the data.');
         }
 
-        $token = $profiler->import(file_get_contents($file['tmp_name']));
+        $token = $profiler->import(file_get_contents($file->getPath()));
 
         if (false === $token) {
             throw new \RuntimeException('Problem uploading the data (token already exists).');