• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisiónb454dea7d560a721856490b77b6f5370dbf68c54 (tree)
Tiempo2007-07-29 21:18:08
Autorhenoheno <henoheno>
Commiterhenoheno

Log Message

get_source($join=TRUE): Care for 0 byte files

Cambiar Resumen

Diferencia incremental

--- a/lib/file.php
+++ b/lib/file.php
@@ -1,6 +1,6 @@
11 <?php
22 // PukiWiki - Yet another WikiWikiWeb clone.
3-// $Id: file.php,v 1.81 2007/07/28 14:41:56 henoheno Exp $
3+// $Id: file.php,v 1.82 2007/07/29 12:18:08 henoheno Exp $
44 // Copyright (C)
55 // 2002-2007 PukiWiki Developers Team
66 // 2001-2002 Originally written by yu-ji
@@ -38,7 +38,12 @@ function get_source($page = NULL, $lock = TRUE, $join = FALSE)
3838
3939 if ($join) {
4040 // Returns a value
41- $result = str_replace("\r", '', fread($fp, filesize($path)));
41+ $size = filesize($path);
42+ if ($size > 0) {
43+ $result = str_replace("\r", '', fread($fp, filesize($path)));
44+ } else {
45+ $result = '';
46+ }
4247 } else {
4348 // Returns an array
4449 // Removing line-feeds: Because file() doesn't remove them.