浏览代码

1.文件名获取bug

NoNZero 8 年之前
父节点
当前提交
8aab38f848
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      protected/controller/ClientController.php

+ 2 - 2
protected/controller/ClientController.php

@@ -1166,8 +1166,8 @@ class ClientController extends DooController
             if (isset($fileArray['filepath'])) {
                 $pidArray = $this->actmeasure->getRowByPmid($this->params['tenderid']);
                 $memoStr = iconv('GBK', 'UTF-8', $_POST['Memo']);
-                $fnArray = explode('.', $fileArray['filename']);
-                $filenameStr = iconv('GBK', 'UTF-8', $fnArray[0]);
+                $fname = basename($fileArray['filename'], $fileArray['fileext']);
+                $filenameStr = iconv('GBK', 'UTF-8', $fname);
                 $postArray = array('ownerid' => $this->params['uid'], 'pid' => $pidArray['pid'], 'pmid' => $this->params['tenderid'], 'filename' => $filenameStr, 'filesize' => $fileArray['filesize'], 'fileext' => $fileArray['fileext'], 'filepath' => $fileArray['filepath']);
                 $iaid = $this->itemfile->insertItemFileRecord($postArray);
                 if ($iaid > 1) {