Skip to content

Commit

Permalink
Merge branch '3.9-dev' into patch-9
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Babker committed May 12, 2018
2 parents 50c8e51 + c115608 commit edada09
Show file tree
Hide file tree
Showing 193 changed files with 2,414 additions and 6,134 deletions.
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/Bug_report.md
@@ -0,0 +1,23 @@
---
name: Bug report
about: Create a report to help us improve

---

### Steps to reproduce the issue



### Expected result



### Actual result



### System information (as much as possible)



### Additional comments
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/Custom.md
@@ -0,0 +1,16 @@
---
name: Fix this template
about: Suggest a fix it

---

### What needs to be fixed


### Why this should be fixed


### How would you fix it


### Side Effects expected
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE/Feature_request.md
@@ -0,0 +1,15 @@
---
name: Feature request
about: Suggest an idea for this project

---

### Is your feature request related to a problem? Please describe.



### Describe the solution you'd like



### Additional context
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -11,7 +11,7 @@ What is this?
---------------------
* This is a Joomla! 3.x installation/upgrade package.
* Joomla's [Official website](https://www.joomla.org).
* Joomla! 3.8 [version history](https://docs.joomla.org/Special:MyLanguage/Joomla_3.8_version_history).
* Joomla! 3.9 [version history](https://docs.joomla.org/Special:MyLanguage/Joomla_3.9_version_history).
* Detailed changes are in the [changelog](https://github.com/joomla/joomla-cms/commits/staging).

What is Joomla?
Expand Down
2 changes: 1 addition & 1 deletion README.txt
@@ -1,7 +1,7 @@
1- What is this?
* This is a Joomla! installation/upgrade package to version 3.x
* Joomla! Official site: https://www.joomla.org
* Joomla! 3.8 version history - https://docs.joomla.org/Special:MyLanguage/Joomla_3.8_version_history
* Joomla! 3.9 version history - https://docs.joomla.org/Special:MyLanguage/Joomla_3.9_version_history
* Detailed changes in the Changelog: https://github.com/joomla/joomla-cms/commits/staging

2- What is Joomla?
Expand Down
Expand Up @@ -25,12 +25,13 @@ abstract class CategoryHelperAssociation
*
* @param integer $id Id of the item
* @param string $extension Name of the component
* @param string $layout Category layout
*
* @return array Array of associations for the component categories
*
* @since 3.0
*/
public static function getCategoryAssociations($id = 0, $extension = 'com_content')
public static function getCategoryAssociations($id = 0, $extension = 'com_content', $layout = null)
{
$return = array();

Expand All @@ -46,11 +47,13 @@ public static function getCategoryAssociations($id = 0, $extension = 'com_conten
{
if (class_exists($helperClassname) && is_callable(array($helperClassname, 'getCategoryRoute')))
{
$return[$tag] = $helperClassname::getCategoryRoute($item, $tag);
$return[$tag] = $helperClassname::getCategoryRoute($item, $tag, $layout);
}
else
{
$return[$tag] = 'index.php?option=' . $extension . '&view=category&id=' . $item;
$viewLayout = $layout ? '&layout=' . $layout : '';

$return[$tag] = 'index.php?option=' . $extension . '&view=category&id=' . $item . $viewLayout;
}
}
}
Expand Down
1 change: 1 addition & 0 deletions administrator/components/com_content/config.xml
Expand Up @@ -867,6 +867,7 @@
<option value="author">JAUTHOR</option>
<option value="hits">JGLOBAL_HITS</option>
<option value="tag">JTAG</option>
<option value="month">JMONTH_PUBLISHED</option>
</field>

<field
Expand Down
Expand Up @@ -32,9 +32,9 @@
<?php if ($user->authorise('core.manage', 'com_postinstall') && $this->postinstall_message_count) : ?>
<div class="row-fluid">
<div class="alert alert-info">
<h4>
<h3>
<?php echo JText::_('COM_CPANEL_MESSAGES_TITLE'); ?>
</h4>
</h3>
<p>
<?php echo JText::_('COM_CPANEL_MESSAGES_BODY_NOCLOSE'); ?>
</p>
Expand Down
10 changes: 5 additions & 5 deletions administrator/components/com_installer/controllers/update.php
Expand Up @@ -39,7 +39,7 @@ public function update()
// Get the minimum stability.
$component = JComponentHelper::getComponent('com_installer');
$params = $component->params;
$minimum_stability = $params->get('minimum_stability', JUpdater::STABILITY_STABLE, 'int');
$minimum_stability = (int) $params->get('minimum_stability', JUpdater::STABILITY_STABLE);

$model->update($uid, $minimum_stability);

Expand Down Expand Up @@ -81,11 +81,11 @@ public function find()
// Get the caching duration.
$component = JComponentHelper::getComponent('com_installer');
$params = $component->params;
$cache_timeout = $params->get('cachetimeout', 6, 'int');
$cache_timeout = (int) $params->get('cachetimeout', 6);
$cache_timeout = 3600 * $cache_timeout;

// Get the minimum stability.
$minimum_stability = $params->get('minimum_stability', JUpdater::STABILITY_STABLE, 'int');
$minimum_stability = (int) $params->get('minimum_stability', JUpdater::STABILITY_STABLE);

// Find updates.
/** @var InstallerModelUpdate $model */
Expand Down Expand Up @@ -156,13 +156,13 @@ public function ajax()

if ($cache_timeout == 0)
{
$cache_timeout = $params->get('cachetimeout', 6, 'int');
$cache_timeout = (int) $params->get('cachetimeout', 6);
$cache_timeout = 3600 * $cache_timeout;
}

if ($minimum_stability < 0)
{
$minimum_stability = $params->get('minimum_stability', JUpdater::STABILITY_STABLE, 'int');
$minimum_stability = (int) $params->get('minimum_stability', JUpdater::STABILITY_STABLE);
}

/** @var InstallerModelUpdate $model */
Expand Down
11 changes: 9 additions & 2 deletions administrator/components/com_installer/models/extension.php
Expand Up @@ -182,8 +182,15 @@ protected function translate(&$items)
$lang->load("$extension.sys", JPATH_SITE, null, false, true);
break;
case 'library':
$extension = 'lib_' . $item->element;
$lang->load("$extension.sys", JPATH_SITE, null, false, true);
$parts = explode('/', $item->element);
$vendor = (isset($parts[1]) ? $parts[0] : null);
$extension = 'lib_' . ($vendor ? implode('_', $parts) : $item->element);

if (!$lang->load("$extension.sys", $path, null, false, true))
{
$source = $path . '/libraries/' . ($vendor ? $vendor . '/' . $parts[1] : $item->element);
$lang->load("$extension.sys", $source, null, false, true);
}
break;
case 'module':
$extension = $item->element;
Expand Down
23 changes: 23 additions & 0 deletions administrator/components/com_installer/models/install.php
Expand Up @@ -170,6 +170,29 @@ public function install()
}
}

// Check the package
$children = $installer->manifest->updateservers->children();

foreach ($children as $child)
{
$check = JInstallerHelper::isChecksumValid($package['packagefile'], (string) $child);

switch ($check)
{
case 0:
$app->enqueueMessage(\JText::_('COM_INSTALLER_INSTALL_CHECKSUM_WRONG'), 'warning');
break;

case 1:
$app->enqueueMessage(\JText::_('COM_INSTALLER_INSTALL_CHECKSUM_CORRECT'), 'message');
break;

case 2:
$app->enqueueMessage(\JText::_('COM_INSTALLER_INSTALL_CHECKSUM_NOT_FOUND'), 'notice');
break;
}
}

// Was the package unpacked?
if (!$package || !$package['type'])
{
Expand Down
23 changes: 20 additions & 3 deletions administrator/components/com_installer/models/update.php
Expand Up @@ -361,7 +361,7 @@ public function update($uids, $minimum_stability = JUpdater::STABILITY_STABLE)
$this->preparePreUpdate($update, $instance);

// Install sets state and enqueues messages
$res = $this->install($update);
$res = $this->install($update, $instance->detailsurl);

if ($res)
{
Expand All @@ -388,13 +388,14 @@ public function update($uids, $minimum_stability = JUpdater::STABILITY_STABLE)
/**
* Handles the actual update installation.
*
* @param JUpdate $update An update definition
* @param JUpdate $update An update definition
* @param string $updateurl Update Server manifest
*
* @return boolean Result of install
*
* @since 1.6
*/
private function install($update)
private function install($update, $updateurl)
{
$app = JFactory::getApplication();

Expand Down Expand Up @@ -448,6 +449,22 @@ private function install($update)
$installer = JInstaller::getInstance();
$update->set('type', $package['type']);

// Check the package
$check = JInstallerHelper::isChecksumValid($package['packagefile'], (string) $updateurl);

switch ($check)
{
case 0:
$app->enqueueMessage(\JText::_('COM_INSTALLER_INSTALL_CHECKSUM_WRONG'), 'warning');
break;
case 1:
$app->enqueueMessage(\JText::_('COM_INSTALLER_INSTALL_CHECKSUM_CORRECT'), 'message');
break;
case 2:
$app->enqueueMessage(\JText::_('COM_INSTALLER_INSTALL_CHECKSUM_NOT_FOUND'), 'notice');
break;
}

// Install the package
if (!$installer->update($package['dir']))
{
Expand Down
24 changes: 20 additions & 4 deletions administrator/components/com_joomlaupdate/controllers/update.php
Expand Up @@ -44,12 +44,28 @@ public function download()
$this->_applyCredentials();

/** @var JoomlaupdateModelDefault $model */
$model = $this->getModel('Default');
$file = $model->download();

$message = null;
$model = $this->getModel('Default');
$result = $model->download();
$file = $result['basename'];
$message = null;
$messageType = null;

switch ($result['check'])
{
case 0:
$message = JText::_('COM_JOOMLAUPDATE_VIEW_UPDATE_CHECKSUM_WRONG');
$messageType = 'warning';
break;
case 1:
$message = JText::_('COM_JOOMLAUPDATE_VIEW_UPDATE_CHECKSUM_CORRECT');
$messageType = 'message';
break;
case 2:
$message = JText::_('COM_JOOMLAUPDATE_VIEW_UPDATE_CHECKSUM_NOT_FOUND');
$messageType = 'notice';
break;
}

if ($file)
{
JFactory::getApplication()->setUserState('com_joomlaupdate.file', $file);
Expand Down
19 changes: 12 additions & 7 deletions administrator/components/com_joomlaupdate/models/default.php
Expand Up @@ -150,7 +150,8 @@ public function getUpdateInformation()
'installed' => JVERSION,
'latest' => null,
'object' => null,
'hasUpdate' => false
'hasUpdate' => false,
'url' => null
);

// Fetch the update information from the database.
Expand Down Expand Up @@ -270,9 +271,10 @@ public function download()
}

// Find the path to the temp directory and the local package.
$config = JFactory::getConfig();
$tempdir = $config->get('tmp_path');
$target = $tempdir . '/' . $basename;
$config = JFactory::getConfig();
$tempdir = $config->get('tmp_path');
$target = $tempdir . '/' . $basename;
$response = array();

// Do we have a cached file?
$exists = JFile::exists($target);
Expand All @@ -289,7 +291,7 @@ public function download()
$mirror++;
}

return $download;
$response['basename'] = $download;
}
else
{
Expand All @@ -307,12 +309,15 @@ public function download()
$mirror++;
}

return $download;
$response['basename'] = $download;
}

// Yes, it's there, skip downloading.
return $basename;
$response['basename'] = $basename;
}

$response['check'] = JInstallerHelper::isChecksumValid($target, $updateInfo['url']);
return $response;
}

/**
Expand Down
6 changes: 5 additions & 1 deletion administrator/components/com_media/config.xml
Expand Up @@ -67,6 +67,7 @@
description="COM_MEDIA_FIELD_CHECK_MIME_DESC"
class="btn-group btn-group-yesno"
default="1"
showon="restrict_uploads:1"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
Expand All @@ -79,6 +80,7 @@
description="COM_MEDIA_FIELD_LEGAL_IMAGE_EXTENSIONS_DESC"
size="50"
default="bmp,gif,jpg,png"
showon="restrict_uploads:1"
/>

<field
Expand All @@ -96,6 +98,7 @@
description="COM_MEDIA_FIELD_LEGAL_MIME_TYPES_DESC"
size="50"
default="image/jpeg,image/gif,image/png,image/bmp,application/msword,application/excel,application/pdf,application/powerpoint,text/plain,application/x-zip"
showon="restrict_uploads:1"
/>

<field
Expand All @@ -105,7 +108,8 @@
description="COM_MEDIA_FIELD_ILLEGAL_MIME_TYPES_DESC"
size="50"
default="text/html"
/>
showon="restrict_uploads:1"
/>
</fieldset>

<fieldset
Expand Down

0 comments on commit edada09

Please sign in to comment.