diff --git a/src/applications/diffusion/query/browse/DiffusionBrowseQuery.php b/src/applications/diffusion/query/browse/DiffusionBrowseQuery.php index 675623e663..5240d031a4 100644 --- a/src/applications/diffusion/query/browse/DiffusionBrowseQuery.php +++ b/src/applications/diffusion/query/browse/DiffusionBrowseQuery.php @@ -95,7 +95,15 @@ abstract class DiffusionBrowseQuery { $readme = null; foreach ($results as $result) { + $file_type = $result->getFileType(); + if (($file_type != ArcanistDiffChangeType::FILE_NORMAL) && + ($file_type != ArcanistDiffChangeType::FILE_TEXT)) { + // Skip directories, etc. + continue; + } + $path = $result->getPath(); + if (preg_match('/^readme(|\.txt|\.remarkup|\.rainbow)$/i', $path)) { $readme = $result; break; @@ -118,7 +126,6 @@ abstract class DiffusionBrowseQuery { $content_query->loadFileContent(); $readme_content = $content_query->getRawData(); - if (preg_match('/\\.txt$/', $readme->getPath())) { $readme_content = phutil_escape_html($readme_content); $readme_content = nl2br($readme_content);