Skip to content

Commit

Permalink
Merge branch '4.3-dev' into 4.3-dev-fix-invalid-json-params-from-pr-3…
Browse files Browse the repository at this point in the history
…8823
  • Loading branch information
richard67 authored May 5, 2023
2 parents c552080 + 0e91992 commit e10d7d7
Show file tree
Hide file tree
Showing 35 changed files with 178 additions and 159 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ INSERT IGNORE INTO `#__guidedtour_steps` (`id`, `tour_id`, `title`, `published`,
(60, 7, 'COM_GUIDEDTOURS_TOUR_BANNERS_STEP_NEW_TITLE', 1, 'COM_GUIDEDTOURS_TOUR_BANNERS_STEP_NEW_DESCRIPTION', 60, 'bottom', '.button-new', 2, 1, 'administrator/index.php?option=com_banners&view=banners', CURRENT_TIMESTAMP(), 0, CURRENT_TIMESTAMP(), 0, '*'),
(61, 7, 'COM_GUIDEDTOURS_TOUR_BANNERS_STEP_TITLE_TITLE', 1, 'COM_GUIDEDTOURS_TOUR_BANNERS_STEP_TITLE_DESCRIPTION', 61, 'bottom', '#jform_name', 2, 2, 'administrator/index.php?option=com_banners&view=banner&layout=edit', CURRENT_TIMESTAMP(), 0, CURRENT_TIMESTAMP(), 0, '*'),
(62, 7, 'COM_GUIDEDTOURS_TOUR_BANNERS_STEP_ALIAS_TITLE', 1, 'COM_GUIDEDTOURS_TOUR_BANNERS_STEP_ALIAS_DESCRIPTION', 62, 'bottom', '#jform_alias', 2, 2, 'administrator/index.php?option=com_banners&view=banner&layout=edit', CURRENT_TIMESTAMP(), 0, CURRENT_TIMESTAMP(), 0, '*'),
(63, 7, 'COM_GUIDEDTOURS_TOUR_BANNERS_STEP_DESCRIPTION_TITLE', 1, 'COM_GUIDEDTOURS_TOUR_BANNERS_STEP_DESCRIPTION_DESCRIPTION', 63, 'bottom', '#jform_description,#jform_description_ifr', 2, 3, 'administrator/index.php?option=com_banners&view=banner&layout=edit', CURRENT_TIMESTAMP(), 0, CURRENT_TIMESTAMP(), 0, '*'),
(63, 7, 'COM_GUIDEDTOURS_TOUR_BANNERS_STEP_DETAILS_TITLE', 1, 'COM_GUIDEDTOURS_TOUR_BANNERS_STEP_DETAILS_DESCRIPTION', 63, 'bottom', '.col-lg-9', 2, 3, 'administrator/index.php?option=com_banners&view=banner&layout=edit', CURRENT_TIMESTAMP(), 0, CURRENT_TIMESTAMP(), 0, '*'),
(64, 7, 'COM_GUIDEDTOURS_TOUR_BANNERS_STEP_STATUS_TITLE', 1, 'COM_GUIDEDTOURS_TOUR_BANNERS_STEP_STATUS_DESCRIPTION', 64, 'bottom', '#jform_state', 2, 3, 'administrator/index.php?option=com_banners&view=banner&layout=edit', CURRENT_TIMESTAMP(), 0, CURRENT_TIMESTAMP(), 0, '*'),
(65, 7, 'COM_GUIDEDTOURS_TOUR_BANNERS_STEP_CATEGORY_TITLE', 1, 'COM_GUIDEDTOURS_TOUR_BANNERS_STEP_CATEGORY_DESCRIPTION', 65, 'top', 'joomla-field-fancy-select .choices[data-type=select-one]', 2, 3, 'administrator/index.php?option=com_banners&view=banner&layout=edit', CURRENT_TIMESTAMP(), 0, CURRENT_TIMESTAMP(), 0, '*'),
(66, 7, 'COM_GUIDEDTOURS_TOUR_BANNERS_STEP_PINNED_TITLE', 1, 'COM_GUIDEDTOURS_TOUR_BANNERS_STEP_PINNED_DESCRIPTION', 66, 'bottom', '#jform_sticky1', 2, 3, 'administrator/index.php?option=com_banners&view=banner&layout=edit', CURRENT_TIMESTAMP(), 0, CURRENT_TIMESTAMP(), 0, '*'),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
UPDATE `#__guidedtour_steps`
SET `title` = 'COM_GUIDEDTOURS_TOUR_BANNERS_STEP_DETAILS_TITLE', `description` = 'COM_GUIDEDTOURS_TOUR_BANNERS_STEP_DETAILS_DESCRIPTION', `target` = '.col-lg-9'
WHERE `id` = 63;
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ INSERT INTO "#__guidedtour_steps" ("id", "tour_id", "title", "published", "descr
(60, 7, 'COM_GUIDEDTOURS_TOUR_BANNERS_STEP_NEW_TITLE', 1, 'COM_GUIDEDTOURS_TOUR_BANNERS_STEP_NEW_DESCRIPTION', 60, 'bottom', '.button-new', 2, 1, 'administrator/index.php?option=com_banners&view=banners', CURRENT_TIMESTAMP, 0, CURRENT_TIMESTAMP, 0, '*'),
(61, 7, 'COM_GUIDEDTOURS_TOUR_BANNERS_STEP_TITLE_TITLE', 1, 'COM_GUIDEDTOURS_TOUR_BANNERS_STEP_TITLE_DESCRIPTION', 61, 'bottom', '#jform_name', 2, 2, 'administrator/index.php?option=com_banners&view=banner&layout=edit', CURRENT_TIMESTAMP, 0, CURRENT_TIMESTAMP, 0, '*'),
(62, 7, 'COM_GUIDEDTOURS_TOUR_BANNERS_STEP_ALIAS_TITLE', 1, 'COM_GUIDEDTOURS_TOUR_BANNERS_STEP_ALIAS_DESCRIPTION', 62, 'bottom', '#jform_alias', 2, 2, 'administrator/index.php?option=com_banners&view=banner&layout=edit', CURRENT_TIMESTAMP, 0, CURRENT_TIMESTAMP, 0, '*'),
(63, 7, 'COM_GUIDEDTOURS_TOUR_BANNERS_STEP_DESCRIPTION_TITLE', 1, 'COM_GUIDEDTOURS_TOUR_BANNERS_STEP_DESCRIPTION_DESCRIPTION', 63, 'bottom', '#jform_description,#jform_description_ifr', 2, 3, 'administrator/index.php?option=com_banners&view=banner&layout=edit', CURRENT_TIMESTAMP, 0, CURRENT_TIMESTAMP, 0, '*'),
(63, 7, 'COM_GUIDEDTOURS_TOUR_BANNERS_STEP_DETAILS_TITLE', 1, 'COM_GUIDEDTOURS_TOUR_BANNERS_STEP_DETAILS_DESCRIPTION', 63, 'bottom', '.col-lg-9', 2, 3, 'administrator/index.php?option=com_banners&view=banner&layout=edit', CURRENT_TIMESTAMP, 0, CURRENT_TIMESTAMP, 0, '*'),
(64, 7, 'COM_GUIDEDTOURS_TOUR_BANNERS_STEP_STATUS_TITLE', 1, 'COM_GUIDEDTOURS_TOUR_BANNERS_STEP_STATUS_DESCRIPTION', 64, 'bottom', '#jform_state', 2, 3, 'administrator/index.php?option=com_banners&view=banner&layout=edit', CURRENT_TIMESTAMP, 0, CURRENT_TIMESTAMP, 0, '*'),
(65, 7, 'COM_GUIDEDTOURS_TOUR_BANNERS_STEP_CATEGORY_TITLE', 1, 'COM_GUIDEDTOURS_TOUR_BANNERS_STEP_CATEGORY_DESCRIPTION', 65, 'top', 'joomla-field-fancy-select .choices[data-type=select-one]', 2, 3, 'administrator/index.php?option=com_banners&view=banner&layout=edit', CURRENT_TIMESTAMP, 0, CURRENT_TIMESTAMP, 0, '*'),
(66, 7, 'COM_GUIDEDTOURS_TOUR_BANNERS_STEP_PINNED_TITLE', 1, 'COM_GUIDEDTOURS_TOUR_BANNERS_STEP_PINNED_DESCRIPTION', 66, 'bottom', '#jform_sticky1', 2, 3, 'administrator/index.php?option=com_banners&view=banner&layout=edit', CURRENT_TIMESTAMP, 0, CURRENT_TIMESTAMP, 0, '*'),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
UPDATE "#__guidedtour_steps"
SET "title" = 'COM_GUIDEDTOURS_TOUR_BANNERS_STEP_DETAILS_TITLE', "description" = 'COM_GUIDEDTOURS_TOUR_BANNERS_STEP_DETAILS_DESCRIPTION', "target" = '.col-lg-9'
WHERE "id" = 63;
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,9 @@ public function &getInfo(): array
*/
public function phpinfoEnabled(): bool
{
return !\in_array('phpinfo', explode(',', ini_get('disable_functions')));
// remove any spaces from the ini value before exploding it
$disabledFunctions = str_replace(' ', '', ini_get('disable_functions'));
return !\in_array('phpinfo', explode(',', $disabledFunctions));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

/** @var \Joomla\Component\Banners\Administrator\View\Banners\HtmlView $this */

$published = $this->state->get('filter.published');
$published = (int) $this->state->get('filter.published');
?>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public function display($tpl = null): void
throw new GenericDataException(implode("\n", $errors), 500);
}

if (!\count($this->data)) {
if (!\count($this->data) && $this->state->get('filter.search') === '') {
$this->setLayout('emptystate');
}

Expand Down
12 changes: 12 additions & 0 deletions administrator/components/com_content/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,8 @@
type="number"
label="JGLOBAL_SHOW_READMORE_LIMIT_LABEL"
filter="integer"
validate="number"
min="0"
default="100"
showon="show_readmore:1[AND]show_readmore_title:1"
/>
Expand Down Expand Up @@ -416,6 +418,8 @@
type="number"
label="JGLOBAL_HISTORY_LIMIT_OPTIONS_LABEL"
filter="integer"
validate="number"
min="0"
default="10"
showon="save_history:1"
/>
Expand Down Expand Up @@ -723,6 +727,8 @@
type="number"
label="JGLOBAL_NUM_LEADING_ARTICLES_LABEL"
filter="integer"
validate="number"
min="0"
default="1"
/>

Expand All @@ -738,6 +744,8 @@
type="number"
label="JGLOBAL_NUM_INTRO_ARTICLES_LABEL"
filter="integer"
validate="number"
min="0"
default="4"
/>

Expand All @@ -754,6 +762,8 @@
type="number"
label="JGLOBAL_NUM_COLUMNS_LABEL"
filter="integer"
validate="number"
min="0"
default="1"
/>

Expand All @@ -773,6 +783,8 @@
type="number"
label="JGLOBAL_NUM_LINKS_LABEL"
filter="integer"
validate="number"
min="0"
default="4"
/>

Expand Down
41 changes: 16 additions & 25 deletions administrator/components/com_media/resources/scripts/app/Api.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,35 +107,26 @@ class Api {

/**
* Get the contents of a directory from the server
* @param {string} dir The directory path
* @param {number} full whether or not the persistent url should be returned
* @param {number} content whether or not the content should be returned
* @param {string} dir The directory path
* @param {boolean} full whether or not the persistent url should be returned
* @param {boolean} content whether or not the content should be returned
* @returns {Promise}
*/
getContents(dir, full, content) {
getContents(dir, full = false, content = false) {
// Wrap the ajax call into a real promise
return new Promise((resolve, reject) => {
// Do a check on full
if (['0', '1'].indexOf(full) !== -1) {
throw Error('Invalid parameter: full');
}
// Do a check on download
if (['0', '1'].indexOf(content) !== -1) {
throw Error('Invalid parameter: content');
}

let url = `${this.baseUrl}&task=api.files&path=${encodeURIComponent(dir)}`;
const url = new URL(`${this.baseUrl}&task=api.files&path=${encodeURIComponent(dir)}`);

if (full) {
url += `&url=${full}`;
url.searchParams.append('url', full);
}

if (content) {
url += `&content=${content}`;
url.searchParams.append('content', content);
}

Joomla.request({
url,
url: url.toString(),
method: 'GET',
headers: { 'Content-Type': 'application/json' },
onSuccess: (response) => {
Expand All @@ -157,11 +148,11 @@ class Api {
createDirectory(name, parent) {
// Wrap the ajax call into a real promise
return new Promise((resolve, reject) => {
const url = `${this.baseUrl}&task=api.files&path=${encodeURIComponent(parent)}`;
const url = new URL(`${this.baseUrl}&task=api.files&path=${encodeURIComponent(parent)}`);
const data = { [this.csrfToken]: '1', name };

Joomla.request({
url,
url: url.toString(),
method: 'POST',
data: JSON.stringify(data),
headers: { 'Content-Type': 'application/json' },
Expand All @@ -188,7 +179,7 @@ class Api {
upload(name, parent, content, override) {
// Wrap the ajax call into a real promise
return new Promise((resolve, reject) => {
const url = `${this.baseUrl}&task=api.files&path=${encodeURIComponent(parent)}`;
const url = new URL(`${this.baseUrl}&task=api.files&path=${encodeURIComponent(parent)}`);
const data = {
[this.csrfToken]: '1',
name,
Expand All @@ -201,7 +192,7 @@ class Api {
}

Joomla.request({
url,
url: url.toString(),
method: 'POST',
data: JSON.stringify(data),
headers: { 'Content-Type': 'application/json' },
Expand All @@ -225,14 +216,14 @@ class Api {
rename(path, newPath) {
// Wrap the ajax call into a real promise
return new Promise((resolve, reject) => {
const url = `${this.baseUrl}&task=api.files&path=${encodeURIComponent(path)}`;
const url = new URL(`${this.baseUrl}&task=api.files&path=${encodeURIComponent(path)}`);
const data = {
[this.csrfToken]: '1',
newPath,
};

Joomla.request({
url,
url: url.toString(),
method: 'PUT',
data: JSON.stringify(data),
headers: { 'Content-Type': 'application/json' },
Expand All @@ -256,11 +247,11 @@ class Api {
delete(path) {
// Wrap the ajax call into a real promise
return new Promise((resolve, reject) => {
const url = `${this.baseUrl}&task=api.files&path=${encodeURIComponent(path)}`;
const url = new URL(`${this.baseUrl}&task=api.files&path=${encodeURIComponent(path)}`);
const data = { [this.csrfToken]: '1' };

Joomla.request({
url,
url: url.toString(),
method: 'DELETE',
data: JSON.stringify(data),
headers: { 'Content-Type': 'application/json' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<div class="media-sidebar">
<MediaDisk
v-for="(disk, index) in disks"
:key="index"
:uid="index"
:key="index.toString()"
:uid="index.toString()"
:disk="disk"
/>
</div>
Expand Down Expand Up @@ -78,7 +78,7 @@ export default {
});
// Initial load the data
this.$store.dispatch('getContents', this.$store.state.selectedDirectory);
this.$store.dispatch('getContents', this.$store.state.selectedDirectory, false, false);
},
beforeUnmount() {
// Remove the global resize event listener
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ export default {
h(this.itemType(), {
item: this.item,
onToggleSettings: this.toggleSettings,
focused: false,
}),
],
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export default {
methods: {
navigateTo(path) {
this.$store.dispatch('getContents', path);
this.$store.dispatch('getContents', path, false, false);
},
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const getContents = (context, payload) => {
updateUrlPath(payload);
context.commit(types.SET_IS_LOADING, true);

api.getContents(payload, 0)
api.getContents(payload, false, false)
.then((contents) => {
context.commit(types.LOAD_CONTENTS_SUCCESS, contents);
context.commit(types.UNSELECT_ALL_BROWSER_ITEMS);
Expand All @@ -51,7 +51,7 @@ export const getContents = (context, payload) => {
*/
export const getFullContents = (context, payload) => {
context.commit(types.SET_IS_LOADING, true);
api.getContents(payload.path, 1)
api.getContents(payload.path, true, true)
.then((contents) => {
context.commit(types.LOAD_FULL_CONTENTS_SUCCESS, contents.files[0]);
context.commit(types.SET_IS_LOADING, false);
Expand All @@ -69,7 +69,7 @@ export const getFullContents = (context, payload) => {
* @param payload
*/
export const download = (context, payload) => {
api.getContents(payload.path, 0, 1)
api.getContents(payload.path, false, true)
.then((contents) => {
const file = contents.files[0];

Expand Down
3 changes: 2 additions & 1 deletion administrator/components/com_media/src/Model/ApiModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Factory;
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Model\BaseDatabaseModel;
use Joomla\CMS\Object\CMSObject;
use Joomla\CMS\Plugin\PluginHelper;
Expand Down Expand Up @@ -230,7 +231,7 @@ public function createFile($adapter, $name, $path, $data, $override)

// Check if it is a media file
if (!$this->isMediaFile($path . '/' . $name)) {
throw new InvalidPathException();
throw new InvalidPathException(Text::_('JLIB_MEDIA_ERROR_WARNFILETYPE'));
}

$app = Factory::getApplication();
Expand Down
4 changes: 2 additions & 2 deletions administrator/language/en-GB/com_guidedtours.sys.ini
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,8 @@ COM_GUIDEDTOURS_TOUR_BANNERS_STEP_TITLE_DESCRIPTION="Enter a required title for
COM_GUIDEDTOURS_TOUR_BANNERS_STEP_ALIAS_TITLE="Enter an alias"
COM_GUIDEDTOURS_TOUR_BANNERS_STEP_ALIAS_DESCRIPTION="You can write the internal name of this banner. You can leave this blank and a default value in lower case with dashes instead of spaces will be used as part of the URL."

COM_GUIDEDTOURS_TOUR_BANNERS_STEP_DESCRIPTION_TITLE="Add a description"
COM_GUIDEDTOURS_TOUR_BANNERS_STEP_DESCRIPTION_DESCRIPTION="Add a description for the banner in the editor."
COM_GUIDEDTOURS_TOUR_BANNERS_STEP_DETAILS_TITLE="Enter detailed information"
COM_GUIDEDTOURS_TOUR_BANNERS_STEP_DETAILS_DESCRIPTION="Add the details for the banner here."

COM_GUIDEDTOURS_TOUR_BANNERS_STEP_STATUS_TITLE="Select the status"
COM_GUIDEDTOURS_TOUR_BANNERS_STEP_STATUS_DESCRIPTION="Select the published status of the banner."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
; Note : All ini files need to be saved as UTF-8

PLG_SYSTEM_UPDATENOTIFICATION="System - Joomla! Update Notification"
PLG_SYSTEM_UPDATENOTIFICATION_EMAIL_BODY="This email IS NOT sent by the Joomla! project. It is sent automatically by your own site,\n{SITENAME} - {URL} \n\n================================================================================\nUPDATE INFORMATION\n================================================================================\n\nYour site has discovered that there is an updated version of Joomla! available for download.\n\nJoomla! version currently installed: {CURVERSION}\nJoomla! version available for installation: {NEWVERSION}\n\nThis email is sent to you by your site to remind you of this fact.\nThe Joomla! project will never contact you directly about available updates of Joomla! on your site.\n\n================================================================================\nUPDATE INSTRUCTIONS\n================================================================================\n\nTo install the update on {SITENAME} please select the following link. (If the URL is not a link, copy & paste it to your browser).\n\nUpdate link: {LINK}\n\nRelease News can be found here: {RELEASENEWS}\n\n================================================================================\nWHY AM I RECEIVING THIS EMAIL?\n================================================================================\n\nThis email has been automatically sent by a plugin provided by Joomla!, the software which powers your site.\nThis plugin looks for updated versions of Joomla! and sends an email notification to its administrators.\nYou will receive several similar emails from your site until you either update the software or disable these emails.\n\nTo disable these emails, please unpublish the 'System - Joomla! Update Notification' plugin in the Plugin Manager on your site.\n\nIf you do not understand what Joomla! is and what you need to do please do not contact the Joomla! project.\nThey are NOT sending you this email and they cannot help you. Instead, please contact the person who built or manages your site.\n\nIf you are the person who built or manages your website, please note that this plugin may have been activated automatically when you installed or updated Joomla! on your site.\n\n================================================================================\nWHO SENT ME THIS EMAIL?\n================================================================================\n\nThis email is sent to you by your own site, {SITENAME}"
PLG_SYSTEM_UPDATENOTIFICATION_EMAIL_BODY="This email IS NOT sent by the Joomla! project. It is sent automatically by your own site,\n{SITENAME} - {URL} \n\n================================================================================\nUPDATE INFORMATION\n================================================================================\n\nYour site has discovered that there is an updated version of Joomla! available.\n\nJoomla! version currently installed: {CURVERSION}\nJoomla! version available for installation: {NEWVERSION}\n\nThis email is sent to you by your site to remind you of this fact.\nThe Joomla! project will never contact you directly about available updates of Joomla! on your site.\n\n================================================================================\nUPDATE INSTRUCTIONS\n================================================================================\n\nTo install the update on {SITENAME} please select the following link. (If the URL is not a link, copy & paste it to your browser).\n\nUpdate link: {LINK}\n\nRelease News can be found here: {RELEASENEWS}\n\n================================================================================\nWHY AM I RECEIVING THIS EMAIL?\n================================================================================\n\nThis email has been automatically sent by a plugin provided by Joomla!, the software which powers your site.\nThis plugin looks for updated versions of Joomla! and sends an email notification to its administrators.\nYou will receive several similar emails from your site until you either update the software or disable these emails.\n\nTo disable these emails, please unpublish the 'System - Joomla! Update Notification' plugin in the Plugin Manager on your site.\n\nIf you do not understand what Joomla! is and what you need to do please do not contact the Joomla! project.\nThey are NOT sending you this email and they cannot help you. Instead, please contact the person who built or manages your site.\n\nIf you are the person who built or manages your website, please note that this plugin may have been activated automatically when you installed or updated Joomla! on your site.\n\n================================================================================\nWHO SENT ME THIS EMAIL?\n================================================================================\n\nThis email is sent to you by your own site, {SITENAME}"
PLG_SYSTEM_UPDATENOTIFICATION_EMAIL_DESC="A comma separated list of the email addresses which will receive the update notification emails. The addresses in the list MUST belong to existing users of your site who have the Super User privilege. If none of the listed emails belongs to Super Users, or if it's left blank, all Super Users of this site will receive the update notification email."
PLG_SYSTEM_UPDATENOTIFICATION_EMAIL_LBL="Super User Emails"
; You can use the following merge codes:
Expand Down
Loading

0 comments on commit e10d7d7

Please sign in to comment.