Index: branches/5.3.x/core/kernel/utility/http_query.php
===================================================================
diff -u -N -r15650 -r15652
--- branches/5.3.x/core/kernel/utility/http_query.php (.../http_query.php) (revision 15650)
+++ branches/5.3.x/core/kernel/utility/http_query.php (.../http_query.php) (revision 15652)
@@ -1,6 +1,6 @@
Application->VerifyThemeId();
$this->Application->VerifyLanguageId();
}
+
+ if ( !$this->Application->isAdmin && $this->Application->ConfigValue('ForceCanonicalUrls') ) {
+ $template = $this->Application->GetVar('t');
+ $seo_template = $this->Application->getSeoTemplate($template);
+
+ if ( $seo_template && $seo_template != $template ) {
+ $url_params = $this->getRedirectParams();
+ $url_params['response_code'] = 301;
+
+ trigger_error('Request url "' . $_SERVER['REQUEST_URI'] . '" points directly to physical template', E_USER_NOTICE);
+ $this->Application->Redirect($seo_template, $url_params);
+ }
+ }
}
/**
Index: branches/5.3.x/core/install/english.lang
===================================================================
diff -u -N -r15650 -r15652
--- branches/5.3.x/core/install/english.lang (.../english.lang) (revision 15650)
+++ branches/5.3.x/core/install/english.lang (.../english.lang) (revision 15652)
@@ -171,6 +171,7 @@
RXhjbHVkZSB0ZW1wbGF0ZSBiYXNlZCBTZWN0aW9ucyBmcm9tIFNlYXJjaCBSZXN1bHRzIChpZS4gVXNlciBSZWdpc3RyYXRpb24p
RmlsZW5hbWUgU3BlY2lhbCBDaGFyIFJlcGxhY2VtZW50
Rmlyc3QgRGF5IE9mIFdlZWs=
+ Rm9yY2UgQ2Fub25pY2FsIFVSTHM=
QWx3YXlzIHVzZSBJbWFnZU1hZ2ljayB0byByZXNpemUgaW1hZ2Vz
Rm9yY2UgUmVkaXJlY3QgdG8gU2VsZWN0ZWQgVVJMIEVuZGluZw==
UmVkaXJlY3QgdG8gSFRUUCB3aGVuIFNTTCBpcyBub3QgcmVxdWlyZWQ=
@@ -2212,4 +2213,4 @@
-
\ No newline at end of file
+
Index: branches/5.3.x/core/kernel/managers/url_manager.php
===================================================================
diff -u -N -r15483 -r15652
--- branches/5.3.x/core/kernel/managers/url_manager.php (.../url_manager.php) (revision 15483)
+++ branches/5.3.x/core/kernel/managers/url_manager.php (.../url_manager.php) (revision 15652)
@@ -1,6 +1,6 @@
Application->GetVar('m_theme');
+
+ return isset($this->structureTemplateMapping[$mapping_key]) ? $this->structureTemplateMapping[$mapping_key] : '';
+ }
+
+ /**
* Returns template name, that corresponds with given virtual (not physical) page id
*
* @param int $page_id
@@ -454,4 +468,4 @@
return $vars;
}
-}
\ No newline at end of file
+}
Index: branches/5.3.x/core/install/install_data.sql
===================================================================
diff -u -N -r15650 -r15652
--- branches/5.3.x/core/install/install_data.sql (.../install_data.sql) (revision 15650)
+++ branches/5.3.x/core/install/install_data.sql (.../install_data.sql) (revision 15652)
@@ -32,6 +32,7 @@
INSERT INTO SystemSettings VALUES(DEFAULT, 'PageHitCounter', '0', 'In-Portal', 'in-portal:configure_advanced', '', '', '', NULL, NULL, 0, 0, 0, NULL);
INSERT INTO SystemSettings VALUES(DEFAULT, 'UseModRewrite', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_use_modrewrite', 'checkbox', '', '', 10.01, 0, 1, NULL);
INSERT INTO SystemSettings VALUES(DEFAULT, 'ModRewriteUrlEnding', '.html', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_ModRewriteUrlEnding', 'select', '', '=+||/=+/||.html=+.html', 10.011, 0, 0, NULL);
+INSERT INTO SystemSettings VALUES(DEFAULT, 'ForceCanonicalUrls', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_ForceCanonicalUrls', 'checkbox', '', '', 10.0125, 0, 0, NULL);
INSERT INTO SystemSettings VALUES(DEFAULT, 'ForceModRewriteUrlEnding', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_ForceModRewriteUrlEnding', 'checkbox', '', NULL, 10.012, 0, 0, 'hint:la_config_ForceModRewriteUrlEnding');
INSERT INTO SystemSettings VALUES(DEFAULT, 'UseContentLanguageNegotiation', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_UseContentLanguageNegotiation', 'checkbox', '', '', 10.013, 0, 0, NULL);
INSERT INTO SystemSettings VALUES(DEFAULT, 'cms_DefaultDesign', '#default_design#', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_DefaultDesignTemplate', 'text', NULL, NULL, 10.02, 0, 0, NULL);
@@ -1030,4 +1031,4 @@
INSERT INTO PromoBlockGroups VALUES (DEFAULT, 'Default Group', UNIX_TIMESTAMP(), '1', '7.00', '0.60', '1', 'fade', '');
INSERT INTO Modules VALUES ('Core', 'core/', 'adm', DEFAULT, 1, 1, '', 0, NULL, NULL);
-INSERT INTO Modules VALUES ('In-Portal', 'core/', 'm', DEFAULT, 1, 0, '', 0, NULL, NULL);
\ No newline at end of file
+INSERT INTO Modules VALUES ('In-Portal', 'core/', 'm', DEFAULT, 1, 0, '', 0, NULL, NULL);
Index: branches/5.3.x/core/kernel/application.php
===================================================================
diff -u -N -r15650 -r15652
--- branches/5.3.x/core/kernel/application.php (.../application.php) (revision 15650)
+++ branches/5.3.x/core/kernel/application.php (.../application.php) (revision 15652)
@@ -1,6 +1,6 @@
UrlManager->getSeoTemplate($physical_template);
+ }
+
+ /**
* Returns template name, that corresponds with given virtual (not physical) page id
*
* @param int $page_id
Index: branches/5.3.x/core/install/upgrades.sql
===================================================================
diff -u -N -r15650 -r15652
--- branches/5.3.x/core/install/upgrades.sql (.../upgrades.sql) (revision 15650)
+++ branches/5.3.x/core/install/upgrades.sql (.../upgrades.sql) (revision 15652)
@@ -2887,3 +2887,5 @@
INSERT INTO SystemSettings VALUES(DEFAULT, 'RandomString', '', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsSystem', 'la_config_RandomString', 'text', '', '', 60.09, 0, 1, NULL);
INSERT INTO SystemSettings VALUES(DEFAULT, 'PlainTextCookies', '', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsSystem', 'la_config_PlainTextCookies', 'text', '', '', 60.10, 0, 1, NULL);
+
+INSERT INTO SystemSettings VALUES(DEFAULT, 'ForceCanonicalUrls', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_ForceCanonicalUrls', 'checkbox', '', '', 10.0125, 0, 0, NULL);