• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

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

Commit MetaInfo

修訂09ff72b7d27fefd33700a030bb4c073a804dd668 (tree)
時間2014-11-30 09:34:28
作者henoheno <henoheno>
Commiterumorigu

Log Message

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

Change Summary

差異

--- a/lib/file.php
+++ b/lib/file.php
@@ -31,7 +31,12 @@ function get_source($page = NULL, $lock = TRUE, $join = FALSE)
3131
3232 if ($join) {
3333 // Returns a value
34- $result = str_replace("\r", '', fread($fp, filesize($path)));
34+ $size = filesize($path);
35+ if ($size > 0) {
36+ $result = str_replace("\r", '', fread($fp, filesize($path)));
37+ } else {
38+ $result = '';
39+ }
3540 } else {
3641 // Returns an array
3742 // Removing line-feeds: Because file() doesn't remove them.