Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1050565
D36.id91.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Jul 2, 11:24 PM
Size
986 B
Mime Type
text/x-diff
Expires
Thu, Jul 3, 11:24 PM (11 h, 42 m)
Engine
blob
Format
Raw Data
Handle
678795
Attached To
D36: INP-1400 - Store resized images from theme under /system folder
D36.id91.diff
View Options
Index: core/units/helpers/image_helper.php
===================================================================
--- core/units/helpers/image_helper.php
+++ core/units/helpers/image_helper.php
@@ -124,6 +124,13 @@
$src_path_escaped = preg_replace('/(\\\[\d]+)/', '\\\\\1', $src_path); // escape replacement patterns, like "\<number>"
$dst_image = preg_replace('/^'.preg_quote($src_path, '/').'(.*)\.(.*)$/', $src_path_escaped . DIRECTORY_SEPARATOR . 'resized\\1_' . crc32(serialize($params)) . '.\\2', $src_image);
+ // Keep resized version of theme-based images under "system" folder.
+ $theme_path = $this->Application->GetFrontThemePath();
+
+ if ( preg_match('/^' . preg_quote(FULL_PATH . $theme_path, '/') . '(.*)$/', $dst_image, $regs) ) {
+ $dst_image = WRITEABLE . $theme_path . $regs[1];
+ }
+
$this->fileHelper->CheckFolder( dirname($dst_image) );
if (!file_exists($dst_image) || filemtime($src_image) > filemtime($dst_image)) {
Event Timeline
Log In to Comment