PukiWiki
Revision | 2ec8d297ee2528b4d193f03564b6d06631364271 (tree) |
---|---|
Time | 2016-02-07 10:04:51 |
Author | umorigu <umorigu@gmai...> |
Commiter | umorigu |
BugTrack2/376 Keep prev spec: return value of AttachFile::getstatus
* Return TRUE if a target file exists
* Return FAlSE if not exists
* Read status file(.log) regardless of active file existance
@@ -1,7 +1,7 @@ | ||
1 | 1 | <?php |
2 | 2 | // PukiWiki - Yet another WikiWikiWeb clone |
3 | -// $Id: attach.inc.php,v 1.92 2011/01/25 15:01:01 henoheno Exp $ | |
4 | -// Copyright (C) | |
3 | +// attach.inc.php | |
4 | +// Copyright | |
5 | 5 | // 2003-2016 PukiWiki Development Team |
6 | 6 | // 2002-2003 PANDA <panda@arino.jp> http://home.arino.jp/ |
7 | 7 | // 2002 Y.MASUI <masui@hisec.co.jp> http://masui.net/pukiwiki/ |
@@ -453,8 +453,6 @@ class AttachFile | ||
453 | 453 | // ファイル情報取得 |
454 | 454 | function getstatus() |
455 | 455 | { |
456 | - if (! file_exists($this->logname)) return FALSE; | |
457 | - | |
458 | 456 | // ログファイル取得 |
459 | 457 | if (file_exists($this->logname)) { |
460 | 458 | $data = file($this->logname); |
@@ -463,11 +461,11 @@ class AttachFile | ||
463 | 461 | } |
464 | 462 | $this->status['count'] = explode(',', $this->status['count']); |
465 | 463 | } |
464 | + if (! $this->exist) return FALSE; | |
466 | 465 | $this->time_str = get_date('Y/m/d H:i:s', $this->time); |
467 | 466 | $this->size = filesize($this->filename); |
468 | 467 | $this->size_str = sprintf('%01.1f', round($this->size/1024, 1)) . 'KB'; |
469 | 468 | $this->type = attach_mime_content_type($this->filename, $this->file); |
470 | - | |
471 | 469 | return TRUE; |
472 | 470 | } |
473 | 471 |