Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14767190
D21195.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D21195.id.diff
View Options
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -3371,6 +3371,7 @@
'PhabricatorFactRaw' => 'applications/fact/storage/PhabricatorFactRaw.php',
'PhabricatorFactUpdateIterator' => 'applications/fact/extract/PhabricatorFactUpdateIterator.php',
'PhabricatorFailHisecUserLogType' => 'applications/people/userlog/PhabricatorFailHisecUserLogType.php',
+ 'PhabricatorFaviconController' => 'applications/system/controller/PhabricatorFaviconController.php',
'PhabricatorFaviconRef' => 'applications/files/favicon/PhabricatorFaviconRef.php',
'PhabricatorFaviconRefQuery' => 'applications/files/favicon/PhabricatorFaviconRefQuery.php',
'PhabricatorFavoritesApplication' => 'applications/favorites/application/PhabricatorFavoritesApplication.php',
@@ -9852,6 +9853,7 @@
'PhabricatorFactRaw' => 'PhabricatorFactDAO',
'PhabricatorFactUpdateIterator' => 'PhutilBufferedIterator',
'PhabricatorFailHisecUserLogType' => 'PhabricatorUserLogType',
+ 'PhabricatorFaviconController' => 'PhabricatorController',
'PhabricatorFaviconRef' => 'Phobject',
'PhabricatorFaviconRefQuery' => 'Phobject',
'PhabricatorFavoritesApplication' => 'PhabricatorApplication',
diff --git a/src/applications/system/application/PhabricatorSystemApplication.php b/src/applications/system/application/PhabricatorSystemApplication.php
--- a/src/applications/system/application/PhabricatorSystemApplication.php
+++ b/src/applications/system/application/PhabricatorSystemApplication.php
@@ -24,6 +24,7 @@
return array(
'/status/' => 'PhabricatorStatusController',
'/debug/' => 'PhabricatorDebugController',
+ '/favicon.ico' => 'PhabricatorFaviconController',
'/robots.txt' => 'PhabricatorRobotsController',
'/services/' => array(
'encoding/' => 'PhabricatorSystemSelectEncodingController',
diff --git a/src/applications/system/controller/PhabricatorFaviconController.php b/src/applications/system/controller/PhabricatorFaviconController.php
new file mode 100644
--- /dev/null
+++ b/src/applications/system/controller/PhabricatorFaviconController.php
@@ -0,0 +1,36 @@
+<?php
+
+final class PhabricatorFaviconController
+ extends PhabricatorController {
+
+ public function shouldRequireLogin() {
+ return false;
+ }
+
+ public function handleRequest(AphrontRequest $request) {
+ // See PHI1719. Phabricator uses "<link /"> tags in the document body
+ // to direct user agents to icons, like this:
+ //
+ // <link rel="icon" href="..." />
+ //
+ // However, some software requests the hard-coded path "/favicon.ico"
+ // directly. To tidy the logs, serve some reasonable response rather than
+ // a 404.
+
+ // NOTE: Right now, this only works for the "PhabricatorPlatformSite".
+ // Other sites (like custom Phame blogs) won't currently route this
+ // path.
+
+ $ref = id(new PhabricatorFaviconRef())
+ ->setWidth(64)
+ ->setHeight(64);
+
+ id(new PhabricatorFaviconRefQuery())
+ ->withRefs(array($ref))
+ ->execute();
+
+ return id(new AphrontRedirectResponse())
+ ->setIsExternal(true)
+ ->setURI($ref->getURI());
+ }
+}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 24, 5:29 PM (19 h, 44 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7042122
Default Alt Text
D21195.id.diff (3 KB)
Attached To
Mode
D21195: Route hard-coded "/favicon.ico" requests to a favicon resource
Attached
Detach File
Event Timeline
Log In to Comment