55 * AbanteCart, Ideal OpenSource Ecommerce Solution
66 * http://www.AbanteCart.com
77 *
8- * Copyright © 2011-2024 Belavier Commerce LLC
8+ * Copyright © 2011-2025 Belavier Commerce LLC
99 *
1010 * This source file is subject to Open Software License (OSL 3.0)
11- * License details is bundled with this package in the file LICENSE.txt.
11+ * License details are bundled with this package in the file LICENSE.txt.
1212 * It is also available at this URL:
1313 * <http://www.opensource.org/licenses/OSL-3.0>
1414 *
1515 * UPGRADE NOTE:
1616 * Do not edit or add to this file if you wish to upgrade AbanteCart to newer
1717 * versions in the future. If you wish to customize AbanteCart for your
18- * needs please refer to http://www.AbanteCart.com for more information.
18+ * needs, please refer to http://www.AbanteCart.com for more information.
1919 */
2020
2121use AbanteCart \PBRender ;
@@ -172,8 +172,9 @@ public function onAHook_InitEnd()
172172 {
173173 $ registry = Registry::getInstance ();
174174 if ($ registry ?->get('request ' )->get ['tmpl_id ' ]) {
175- $ registry ?->get('config ' )->set ('config_storefront_template ' , $ registry ->get ('request ' )->get ['tmpl_id ' ]);
176- $ registry ?->set('layout ' , new ALayout ($ registry , $ registry ->get ('request ' )->get ['tmpl_id ' ]));
175+ $ templateTextId = preformatTextID ($ registry ->get ('request ' )->get ['tmpl_id ' ]);
176+ $ registry ->get ('config ' )->set ('config_storefront_template ' , $ templateTextId );
177+ $ registry ->set ('layout ' , new ALayout ($ registry , $ templateTextId ));
177178 }
178179 }
179180
@@ -377,7 +378,7 @@ public function onControllerPagesDesignLayout_UpdateData()
377378
378379 $ execController = $ pageData ['controller ' ];
379380 if (!$ keyParam ) {
380- $ templateTxtId = $ that ->request ->get ['tmpl_id ' ]
381+ $ templateTxtId = preformatTextID ( $ that ->request ->get ['tmpl_id ' ])
381382 ?: Registry::getInstance ()->get ('config ' )->get ('config_storefront_template ' );
382383 $ l = new ALayout (Registry::getInstance (), $ templateTxtId );
383384 $ keyParam = $ l ->getKeyParamByController ($ execController );
@@ -398,7 +399,7 @@ protected function getLayoutIdsByParameters(string $rt, string $keyParam, int $k
398399 $ that = $ this ->baseObject ;
399400 $ pageId = $ layoutId = null ;
400401
401- $ templateTxtId = $ that ->request ->get ['tmpl_id ' ]
402+ $ templateTxtId = preformatTextID ( $ that ->request ->get ['tmpl_id ' ])
402403 ?: Registry::getInstance ()->get ('config ' )->get ('config_storefront_template ' );
403404 $ layout = new ALayout (Registry::getInstance (), $ templateTxtId );
404405 if (!$ keyParam ) {
0 commit comments