Skip to content

Commit

Permalink
Merge branch '4.3-dev' into 4.3-tags-1
Browse files Browse the repository at this point in the history
  • Loading branch information
Hackwar authored Nov 16, 2022
2 parents 7ec608a + 3e2277f commit 47f9758
Show file tree
Hide file tree
Showing 26 changed files with 598 additions and 185 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -475,8 +475,9 @@ public function getComponentOptions()
/**
* Adds or updates a post-installation message (PIM) definition. You can use this in your post-installation script using this code:
*
* require_once JPATH_LIBRARIES . '/fof/include.php';
* FOFModel::getTmpInstance('Messages', 'PostinstallModel')->addPostInstallationMessage($options);
* Factory::getApplication()->bootComponent('com_postinstall')
* ->getMVCFactory()->createModel('Messages', 'Administrator', ['ignore_request' => true])
* ->addPostInstallationMessage($options);
*
* The $options array contains the following mandatory keys:
*
Expand Down Expand Up @@ -526,8 +527,8 @@ public function getComponentOptions()
*
* When type=action the following additional keys are required:
*
* action_file The RAD path to a PHP file containing a PHP function which performs the action of this PIM. @see FOFTemplateUtils::parsePath()
* for RAD path format. Joomla! will include this file before calling the function defined in the action key below.
* action_file The RAD path to a PHP file containing a PHP function which performs the action of this PIM.
* Joomla! will include this file before calling the function defined in the action key below.
* Example: admin://components/com_foobar/helpers/postinstall.php
*
* action The name of a PHP function which will be used to run the action of this PIM. This must be a simple PHP user function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ public function createFile()
$this->setMessage(Text::_('COM_TEMPLATES_INVALID_FILE_TYPE'), 'error');
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file . '&isMedia=' . $this->input->getInt('isMedia', 0);
$this->setRedirect(Route::_($url, false));
} elseif (!preg_match('/^[a-zA-Z0-9-_]+$/', $name)) {
} elseif (!preg_match('/^(?!\.)(?!.*\.$)(?!.*\.\.)[a-zA-Z0-9_.]+$/', $name)) {
$this->setMessage(Text::_('COM_TEMPLATES_INVALID_FILE_NAME'), 'error');
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file . '&isMedia=' . $this->input->getInt('isMedia', 0);
$this->setRedirect(Route::_($url, false));
Expand Down Expand Up @@ -672,7 +672,7 @@ public function renameFile()
$this->setMessage(Text::_('COM_TEMPLATES_ERROR_RENAME_ASSET_FILE'), 'warning');
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file . '&isMedia=' . $isMedia;
$this->setRedirect(Route::_($url, false));
} elseif (!preg_match('/^[a-zA-Z0-9-_]+$/', $newName)) {
} elseif (!preg_match('/^(?!\.)(?!.*\.$)(?!.*\.\.)[a-zA-Z0-9_.]+$/', $newName)) {
$this->setMessage(Text::_('COM_TEMPLATES_INVALID_FILE_NAME'), 'error');
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file . '&isMedia=' . $isMedia;
$this->setRedirect(Route::_($url, false));
Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_users/src/Service/Encrypt.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function encrypt(string $data): string
* Decrypt the ciphertext, prefixed by ###AES128###, and return the plaintext.
*
* @param string $data The ciphertext, prefixed by ###AES128###
* @param bool $legacy Use legacy key expansion? Use it to decrypt data encrypted with FOF 3.
* @param bool $legacy Use legacy key expansion. We recommend against using it.
*
* @return string The plaintext data
*
Expand All @@ -86,7 +86,7 @@ public function decrypt(string $data, bool $legacy = false): string
}

$this->aes->setPassword($this->getPassword(), $legacy);
$decrypted = $this->aes->decryptString($data, true, $legacy);
$decrypted = $this->aes->decryptString($data, true);

// Decrypted data is null byte padded. We have to remove the padding before proceeding.
return rtrim($decrypted, "\0");
Expand Down
2 changes: 1 addition & 1 deletion administrator/language/en-GB/com_categories.ini
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ COM_CATEGORY_COUNT_UNPUBLISHED_ITEMS="Unpublished items"
COM_CATEGORY_HEADING_ASSOCIATION="Association"
JGLOBAL_NO_ITEM_SELECTED="No categories selected."
JLIB_HTML_ACCESS_SUMMARY_DESC="Shown below is an overview of the permission settings for this category. Select the tabs above to customise these settings by action."
JLIB_RULES_SETTING_NOTES_ITEM_COM_CATEGORIES="Changes apply to this category and all child categories.<br><em><strong>Inherited</strong></em> - a Global Configuration setting or higher level setting is applied.<br><em><strong>Denied</strong></em> always wins - whatever is set at the Global or higher level and applies to all child elements.<br><em><strong>Allowed</strong></em> will enable the action for this component unless overruled by a Global Configuration setting."
JLIB_RULES_SETTING_NOTES_ITEM="Changes apply to this category and all child categories.<br><em><strong>Inherited</strong></em> - a Global Configuration setting or higher level setting is applied.<br><em><strong>Denied</strong></em> always wins - whatever is set at the Global or higher level and applies to all child elements.<br><em><strong>Allowed</strong></em> will enable the action for this component unless overruled by a Global Configuration setting."
2 changes: 1 addition & 1 deletion administrator/language/en-GB/com_templates.ini
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ COM_TEMPLATES_HOME_HEADING="Select a File"
COM_TEMPLATES_HOME_TEXT="You can select from a number of options to customise the look of your templates. The Template Manager supports Source files, Image files, Font files, Zip archives and most of the operations that can be performed on those files. Select a file and you are good to go. Check the documentation if you want to know more."
COM_TEMPLATES_IMAGE_HEIGHT="Height"
COM_TEMPLATES_IMAGE_WIDTH="Width"
COM_TEMPLATES_INVALID_FILE_NAME="Invalid file name. Please choose a file name with a-z, A-Z, 0-9, - and _."
COM_TEMPLATES_INVALID_FILE_NAME="Invalid file name. Please choose a file name with a-z, A-Z, 0-9, ., - and _."
COM_TEMPLATES_INVALID_FILE_TYPE="File type not selected."
COM_TEMPLATES_INVALID_FOLDER_NAME="Invalid folder name. Please choose a folder name with a-z, A-Z, 0-9, - and _."
COM_TEMPLATES_LAYOUTS_DIFFVIEW_CORE="Show Original File"
Expand Down
49 changes: 19 additions & 30 deletions components/com_tags/src/Helper/RouteHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class RouteHelper extends CMSRouteHelper
* Lookup-table for menu items
*
* @var array
* @since __DEPLOY_VERSION__
*/
protected static $lookup;

Expand Down Expand Up @@ -107,28 +108,25 @@ public static function getTagRoute($id)
*/
public static function getComponentTagRoute(string $id, string $language = '*'): string
{
$needles = [
'tag' => [(int) $id],
'language' => $language,
];

if ($id < 1) {
$link = '';
} else {
$link = 'index.php?option=com_tags&view=tag&id=' . $id;

if ($item = self::_findItem($needles)) {
$link .= '&Itemid=' . $item;
} else {
$needles = [
'tags' => [1, 0],
'language' => $language,
];

if ($item = self::_findItem($needles)) {
$link .= '&Itemid=' . $item;
}
// We actually would want to allow arrays of tags here, but can't due to B/C
if (!is_array($id)) {
if ($id < 1) {
return '';
}

$id = [$id];
}

$id = array_values(array_filter($id));

if (!count($id)) {
return '';
}

$link = 'index.php?option=com_tags&view=tag';

foreach ($id as $i => $value) {
$link .= '&id[' . $i . ']=' . $value;
}

return $link;
Expand Down Expand Up @@ -162,17 +160,8 @@ public static function getTagsRoute()
*/
public static function getComponentTagsRoute(string $language = '*'): string
{
$needles = [
'tags' => [0],
'language' => $language,
];

$link = 'index.php?option=com_tags&view=tags';

if ($item = self::_findItem($needles)) {
$link .= '&Itemid=' . $item;
}

return $link;
}

Expand Down
Loading

0 comments on commit 47f9758

Please sign in to comment.