• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javaandroidc++linuxc#objective-ccocoa誰得qtrubypythonwindowsphpgamebathyscaphegui翻訳comegattwitterframeworkbtronvb.net計画中(planning stage)testdomarduinodirectxpreviewerゲームエンジン

Commit MetaInfo

Revision09ff72b7d27fefd33700a030bb4c073a804dd668 (tree)
Time2014-11-30 09:34:28
Authorhenoheno <henoheno>
Commiterumorigu

Log Message

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

Change Summary

Incremental Difference

--- 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.