Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1025972
D281.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
Fri, Jun 13, 5:39 PM
Size
1 KB
Mime Type
text/x-diff
Expires
Sat, Jun 14, 5:39 PM (3 h, 25 m)
Engine
blob
Format
Raw Data
Handle
661634
Attached To
D281: INP-1664 - Redirect to Canonical URL, when page is accessed via Short URL
D281.diff
View Options
Index: branches/5.2.x/core/install/upgrades.sql
===================================================================
--- branches/5.2.x/core/install/upgrades.sql
+++ branches/5.2.x/core/install/upgrades.sql
@@ -2940,3 +2940,5 @@
UPDATE Modules
SET ClassNamespace = 'InPortal\\Core'
WHERE `Name` IN ('Core', 'In-Portal');
+
+DELETE FROM CachedUrls;
Index: branches/5.2.x/core/kernel/utility/http_query.php
===================================================================
--- branches/5.2.x/core/kernel/utility/http_query.php
+++ branches/5.2.x/core/kernel/utility/http_query.php
@@ -373,6 +373,16 @@
trigger_error('Non mod-rewrite url "<strong>' . $_SERVER['REQUEST_URI'] . '</strong>" used', E_USER_NOTICE);
$this->Application->Redirect('', $url_params);
}
+
+ if ( $this->Application->GetVar('is_friendly_url') ) {
+ $url_params = $this->getRedirectParams();
+
+ // No idea about how to check, that given template
+ // require category to be passed with it, so pass anyway.
+ $url_params['pass_category'] = 1;
+
+ $this->Application->Redirect('', $url_params);
+ }
}
else {
$this->Application->VerifyThemeId();
Index: branches/5.2.x/core/units/categories/categories_event_handler.php
===================================================================
--- branches/5.2.x/core/units/categories/categories_event_handler.php
+++ branches/5.2.x/core/units/categories/categories_event_handler.php
@@ -3026,7 +3026,8 @@
/** @var kRewriteUrlProcessor $rewrite_processor */
$rewrite_processor = $this->Application->recallObject('kRewriteUrlProcessor');
- if ($friendly) {
+ if ( $friendly ) {
+ $vars['is_friendly_url'] = true;
$vars['m_cat_id'] = $friendly['CategoryId'];
$vars['t'] = preg_replace('/^Content\//i', '', $friendly['NamedParentPath']);
Event Timeline
Log In to Comment