diff --git a/administrator/components/com_admin/script.php b/administrator/components/com_admin/script.php index 33744b5d9d666..f295caa2a7429 100644 --- a/administrator/components/com_admin/script.php +++ b/administrator/components/com_admin/script.php @@ -252,6 +252,9 @@ protected function uninstallRepeatableFieldsPlugin() return; } + // Ensure the FieldsHelper class is loaded for the Repeatable fields plugin we're about to remove + \JLoader::register('FieldsHelper', JPATH_ADMINISTRATOR . '/components/com_fields/helpers/fields.php'); + try { $db->transactionStart(); @@ -6280,6 +6283,8 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false) } } + $this->fixFilenameCasing(); + if ($suppressOutput === false && \count($status['folders_errors'])) { echo implode('
', $status['folders_errors']); @@ -7142,4 +7147,69 @@ private function convertBlogLayouts() $configModel->save($data); } } + + /** + * Renames or removes incorrectly cased files. + * + * @return void + * + * @since 4.0.0 + */ + protected function fixFilenameCasing() + { + $files = array( + // 3.10 changes + 'libraries/src/Filesystem/Support/Stringcontroller.php' => 'libraries/src/Filesystem/Support/StringController.php', + 'libraries/src/Form/Rule/SubFormRule.php' => 'libraries/src/Form/Rule/SubformRule.php', + // 4.0.0 + 'media/vendor/skipto/js/skipTo.js' => 'media/vendor/skipto/js/skipto.js', + ); + + foreach ($files as $old => $expected) + { + $oldRealpath = realpath(JPATH_ROOT . '/' . $old); + + // On Unix without incorrectly cased file. + if ($oldRealpath === false) + { + continue; + } + + $oldBasename = basename($oldRealpath); + $newRealpath = realpath(JPATH_ROOT . '/' . $expected); + $newBasename = basename($newRealpath); + $expectedBasename = basename($expected); + + // On Windows or Unix with only the incorrectly cased file. + if ($newBasename !== $expectedBasename) + { + // Rename the file. + rename(JPATH_ROOT . '/' . $old, JPATH_ROOT . '/' . $old . '.tmp'); + rename(JPATH_ROOT . '/' . $old . '.tmp', JPATH_ROOT . '/' . $expected); + + continue; + } + + // There might still be an incorrectly cased file on other OS than Windows. + if ($oldBasename === basename($old)) + { + // Check if case-insensitive file system, eg on OSX. + if (fileinode($oldRealpath) === fileinode($newRealpath)) + { + // Check deeper because even realpath or glob might not return the actual case. + if (!in_array($expectedBasename, scandir(dirname($newRealpath)))) + { + // Rename the file. + rename(JPATH_ROOT . '/' . $old, JPATH_ROOT . '/' . $old . '.tmp'); + rename(JPATH_ROOT . '/' . $old . '.tmp', JPATH_ROOT . '/' . $expected); + } + } + else + { + // On Unix with both files: Delete the incorrectly cased file. + unlink(JPATH_ROOT . '/' . $old); + } + } + } + } } diff --git a/administrator/components/com_associations/src/View/Associations/HtmlView.php b/administrator/components/com_associations/src/View/Associations/HtmlView.php index 29fcd7034cb60..45f8d407740e9 100644 --- a/administrator/components/com_associations/src/View/Associations/HtmlView.php +++ b/administrator/components/com_associations/src/View/Associations/HtmlView.php @@ -56,7 +56,7 @@ class HtmlView extends BaseHtmlView /** * Selected item type properties. * - * @var Registry + * @var \Joomla\Registry\Registry * * @since 3.7.0 */ diff --git a/administrator/components/com_associations/tmpl/associations/default.php b/administrator/components/com_associations/tmpl/associations/default.php index 939ccb4dd408c..3ed40def53aa7 100644 --- a/administrator/components/com_associations/tmpl/associations/default.php +++ b/administrator/components/com_associations/tmpl/associations/default.php @@ -71,7 +71,7 @@ - + diff --git a/administrator/components/com_banners/tmpl/banners/default.php b/administrator/components/com_banners/tmpl/banners/default.php index 7d42bf25ce31d..0bedb508b340f 100644 --- a/administrator/components/com_banners/tmpl/banners/default.php +++ b/administrator/components/com_banners/tmpl/banners/default.php @@ -100,7 +100,7 @@ ?> - id); ?> + id, false, 'cid', 'cb', $item->name); ?> - id); ?> + id, false, 'cid', 'cb', $item->name); ?> state, $i, 'clients.', $canChange); ?> diff --git a/administrator/components/com_categories/src/Controller/CategoryController.php b/administrator/components/com_categories/src/Controller/CategoryController.php index c797338d350fe..9be5215af4e0a 100644 --- a/administrator/components/com_categories/src/Controller/CategoryController.php +++ b/administrator/components/com_categories/src/Controller/CategoryController.php @@ -153,6 +153,18 @@ public function batch($model = null) protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id') { $append = parent::getRedirectToItemAppend($recordId); + + // In case extension is not passed in the URL, get it directly from category instead of default to com_content + if (!$this->input->exists('extension') && $recordId > 0) + { + $table = $this->getModel('Category')->getTable(); + + if ($table->load($recordId)) + { + $this->extension = $table->extension; + } + } + $append .= '&extension=' . $this->extension; return $append; diff --git a/administrator/components/com_categories/tmpl/categories/default.php b/administrator/components/com_categories/tmpl/categories/default.php index e43df5e1245c1..81a7ac3c2d7b6 100644 --- a/administrator/components/com_categories/tmpl/categories/default.php +++ b/administrator/components/com_categories/tmpl/categories/default.php @@ -160,7 +160,7 @@ ?> - id); ?> + id, false, 'cid', 'cb', $item->title); ?> app->sendHeaders(); // Check if user token is valid. - if (!Session::checkToken('get')) + if (!Session::checkToken()) { $this->app->enqueueMessage(Text::_('JINVALID_TOKEN'), 'error'); echo new JsonResponse; diff --git a/administrator/components/com_config/src/Controller/ComponentController.php b/administrator/components/com_config/src/Controller/ComponentController.php index 5c5cbdf263de4..0bb0ec61e699a 100644 --- a/administrator/components/com_config/src/Controller/ComponentController.php +++ b/administrator/components/com_config/src/Controller/ComponentController.php @@ -201,7 +201,23 @@ public function cancel($key = null) // Clear session data. $this->app->setUserState("$this->option.edit.$this->context.$component.data", null); - $this->setRedirect(Route::_('index.php?option=' . $component, false)); + // Calculate redirect URL + $returnUri = $this->input->post->get('return', null, 'base64'); + + $redirect = 'index.php?option=' . $component; + + if (!empty($returnUri)) + { + $redirect = base64_decode($returnUri); + } + + // Don't redirect to an external URL. + if (!Uri::isInternal($redirect)) + { + $redirect = Uri::base(); + } + + $this->setRedirect(Route::_($redirect, false)); return true; } diff --git a/administrator/components/com_config/src/Field/FiltersField.php b/administrator/components/com_config/src/Field/FiltersField.php index d55edb488f323..f72539fca5458 100644 --- a/administrator/components/com_config/src/Field/FiltersField.php +++ b/administrator/components/com_config/src/Field/FiltersField.php @@ -142,11 +142,11 @@ protected function getInput() . ' class="novalidate form-select"' . '>'; $html[] = ' '; + . Text::_('COM_CONFIG_FIELD_FILTERS_DEFAULT_FORBIDDEN_LIST') . ''; $html[] = ' '; + . Text::_('COM_CONFIG_FIELD_FILTERS_CUSTOM_FORBIDDEN_LIST') . ''; $html[] = ' '; + . Text::_('COM_CONFIG_FIELD_FILTERS_ALLOWED_LIST') . ''; $html[] = ' '; $html[] = '