@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Composing a custom project picture: Remove misaligned empty icon

Summary:
Do not assume that all items under `/resources/builtin/projects/` are image files (some can be subdirectories). Only add PNG files to the map.

Could be nicer to use `is_file()` or `is_dir()` but we are dealing only with string representations of files and folders.

Closes T15696

Test Plan: Go to `/project/picture/1/` and click the `Choose Icon and Color...` button; check last icon shown under "Choose Icon".

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15696

Differential Revision: https://we.phorge.it/D25499

+8 -6
+8 -6
src/applications/files/builtin/PhabricatorFilesComposeIconBuiltinFile.php
··· 51 51 $map = array(); 52 52 $list = Filesystem::listDirectory($root, $include_hidden = false); 53 53 foreach ($list as $file) { 54 - $short = preg_replace('/\.png$/', '', $file); 55 - 56 - $map[$short] = array( 57 - 'path' => $root.$file, 58 - 'quip' => idx($quips, $short, $short), 59 - ); 54 + $count = 0; 55 + $short = preg_replace('/\.png$/', '', $file, -1, $count); 56 + if ($count === 1) { 57 + $map[$short] = array( 58 + 'path' => $root.$file, 59 + 'quip' => idx($quips, $short, $short), 60 + ); 61 + } 60 62 } 61 63 62 64 return $map;