diff --git a/.gitignore b/.gitignore
index 062c89aeebc92..9cfa3c08dc80d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -64,6 +64,8 @@ Desktop.ini
/libraries/vendor/ircmaxell/password-compat/phpunit.xml.dist
/libraries/vendor/ircmaxell/password-compat/README.md
/libraries/vendor/ircmaxell/password-compat/version-test.php
+/libraries/vendor/joomla/*/.gitignore
+/libraries/vendor/joomla/*/.gitmodules
/libraries/vendor/joomla/*/docs
/libraries/vendor/joomla/*/Tests
/libraries/vendor/joomla/*/vendor
diff --git a/.travis.yml b/.travis.yml
index daca2af981830..6d528c3ffd0fd 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -22,6 +22,10 @@ matrix:
env: RUN_PHPCS="yes" INSTALL_APCU="yes"
- php: 7.0
env: INSTALL_APCU="yes" INSTALL_APCU_BC_BETA="no" INSTALL_MEMCACHE="no" INSTALL_MEMCACHED="no" INSTALL_REDIS="no" # Disabled apcu_bc install until https://github.com/travis-ci/travis-ci/issues/5207 is resolved
+ - php: hhvm
+ env: INSTALL_APCU_BC_BETA="no" INSTALL_MEMCACHE="no" INSTALL_MEMCACHED="no" INSTALL_REDIS="no" # Disabled items that currently do not work in travis-ci hhvm
+ allow_failures:
+ - php: hhvm
services:
- memcache
diff --git a/administrator/components/com_admin/models/sysinfo.php b/administrator/components/com_admin/models/sysinfo.php
index 380811284370d..e618573e93e9d 100644
--- a/administrator/components/com_admin/models/sysinfo.php
+++ b/administrator/components/com_admin/models/sysinfo.php
@@ -251,6 +251,7 @@ public function &getPhpSettings()
'zip' => function_exists('zip_open') && function_exists('zip_read'),
'mbstring' => extension_loaded('mbstring'),
'iconv' => function_exists('iconv'),
+ 'mcrypt' => extension_loaded('mcrypt'),
'max_input_vars' => ini_get('max_input_vars'),
);
diff --git a/administrator/components/com_admin/script.php b/administrator/components/com_admin/script.php
index fdf723edc7ed6..728217ed3e31a 100644
--- a/administrator/components/com_admin/script.php
+++ b/administrator/components/com_admin/script.php
@@ -19,7 +19,7 @@ class JoomlaInstallerScript
/**
* Method to update Joomla!
*
- * @param JInstallerFile $installer The class calling this method
+ * @param JInstallerAdapterFile $installer The class calling this method
*
* @return void
*/
@@ -31,13 +31,13 @@ public function update($installer)
JLog::addLogger($options, JLog::INFO, array('Update', 'databasequery', 'jerror'));
JLog::add(JText::_('COM_JOOMLAUPDATE_UPDATE_LOG_DELETE_FILES'), JLog::INFO, 'Update');
- $this->deleteUnexistingFiles();
$this->updateManifestCaches();
$this->updateDatabase();
$this->clearRadCache();
$this->updateAssets();
$this->clearStatsCache();
$this->convertTablesToUtf8mb4();
+ $this->cleanJoomlaCache();
// VERY IMPORTANT! THIS METHOD SHOULD BE CALLED LAST, SINCE IT COULD
// LOGOUT ALL THE USERS
@@ -1853,6 +1853,8 @@ private function serverClaimsUtf8mb4Support($format)
* @param string $query The query to convert
*
* @return string The converted query
+ *
+ * @since 3.5
*/
private function convertUtf8mb4QueryToUtf8($query)
{
@@ -1868,4 +1870,18 @@ private function convertUtf8mb4QueryToUtf8($query)
// Replace utf8mb4 with utf8
return str_replace('utf8mb4', 'utf8', $query);
}
+
+ /**
+ * This method clean the Joomla Cache using the method `clean` from the com_cache model
+ *
+ * @return void
+ *
+ * @since 3.5.1
+ */
+ private function cleanJoomlaCache()
+ {
+ JModelLegacy::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_cache/models');
+ $model = JModelLegacy::getInstance('cache', 'CacheModel');
+ $model->clean();
+ }
}
diff --git a/administrator/components/com_admin/sql/others/mysql/utf8mb4-conversion-01.sql b/administrator/components/com_admin/sql/others/mysql/utf8mb4-conversion-01.sql
index f51d375859d8e..cd40e0b8ae7b3 100644
--- a/administrator/components/com_admin/sql/others/mysql/utf8mb4-conversion-01.sql
+++ b/administrator/components/com_admin/sql/others/mysql/utf8mb4-conversion-01.sql
@@ -12,9 +12,19 @@
-- The file for step 2 will the be processed with reporting exceptions.
--
+ALTER TABLE `#__banners` DROP KEY `idx_metakey_prefix`;
+ALTER TABLE `#__banner_clients` DROP KEY `idx_metakey_prefix`;
+ALTER TABLE `#__categories` DROP KEY `idx_path`;
ALTER TABLE `#__categories` DROP KEY `idx_alias`;
+ALTER TABLE `#__content_types` DROP KEY `idx_alias`;
+ALTER TABLE `#__finder_links` DROP KEY `idx_title`;
ALTER TABLE `#__menu` DROP KEY `idx_alias`;
ALTER TABLE `#__menu` DROP KEY `idx_client_id_parent_id_alias_language`;
+ALTER TABLE `#__menu` DROP KEY `idx_path`;
ALTER TABLE `#__redirect_links` DROP KEY `idx_old_url`;
+ALTER TABLE `#__tags` DROP KEY `idx_path`;
ALTER TABLE `#__tags` DROP KEY `idx_alias`;
ALTER TABLE `#__ucm_content` DROP KEY `idx_alias`;
+ALTER TABLE `#__ucm_content` DROP KEY `idx_title`;
+ALTER TABLE `#__ucm_content` DROP KEY `idx_content_type`;
+ALTER TABLE `#__users` DROP KEY `idx_name`;
diff --git a/administrator/components/com_admin/sql/others/mysql/utf8mb4-conversion-02.sql b/administrator/components/com_admin/sql/others/mysql/utf8mb4-conversion-02.sql
index 7b9f9d9ef0e66..7bb87849af6c6 100644
--- a/administrator/components/com_admin/sql/others/mysql/utf8mb4-conversion-02.sql
+++ b/administrator/components/com_admin/sql/others/mysql/utf8mb4-conversion-02.sql
@@ -1,42 +1,52 @@
--
-- Step 2 of the UTF-8 Multibyte (utf8mb4) conversion for MySQL
--
--- Add back indexes previosly dropped with step 1, utf8mb4-conversion-01.sql,
--- but with limited lenghts of columns, and then perform the conversions
--- for utf8mb4.
+-- Enlarge some database columns to avoid data losses, then convert all tables
+-- to utf8mb4 or utf8, then set default character sets and collations for all
+-- tables, then add back indexes previosly dropped with step 1,
+-- utf8mb4-conversion-01.sql, but addd them back with limited lenghts of
+-- columns.
--
-- Do not rename this file or any other of the utf8mb4-conversion-*.sql
-- files unless you want to change PHP code, too.
--
--- This file here will the be processed with reporting exceptions.
+-- IMPORTANT: When adding an index modification to this file for limiting the
+-- length by which one or more columns go into that index,
--
-
+-- 1. remember to add the statement to drop the index to the file for step 1,
+-- utf8mb4-conversion-01.sql, and
--
--- Step 2.1: Limit indexes to first 100 so their max allowed lengths would not get exceeded with utf8mb4
+-- 2. check if the index is created created or modified in some old schema
+-- update sql in an "ALTER TABLE" statement and limit the column length
+-- there, too ("CREATE TABLE" is ok, no need to modify those).
+--
+-- This file here will the be processed with reporting exceptions, in opposite
+-- to the file for step 1.
--
-
-ALTER TABLE `#__categories` ADD KEY `idx_alias` (`alias`(100));
-ALTER TABLE `#__menu` ADD KEY `idx_alias` (`alias`(100));
-ALTER TABLE `#__menu` ADD UNIQUE `idx_client_id_parent_id_alias_language` (`client_id`,`parent_id`,`alias`(100),`language`);
-ALTER TABLE `#__redirect_links` ADD KEY `idx_old_url` (`old_url`(100));
-ALTER TABLE `#__tags` ADD KEY `idx_alias` (`alias`(100));
-ALTER TABLE `#__ucm_content` ADD KEY `idx_alias` (`core_alias`(100));
--
--- Step 2.2: Enlarge columns to avoid data loss on later conversion to utf8mb4
+-- Step 2.1: Enlarge columns to avoid data loss on later conversion to utf8mb4
--
ALTER TABLE `#__banners` MODIFY `alias` varchar(400) NOT NULL DEFAULT '';
+ALTER TABLE `#__banners` MODIFY `metakey_prefix` varchar(400) NOT NULL DEFAULT '';
+ALTER TABLE `#__categories` MODIFY `path` varchar(400) NOT NULL DEFAULT '';
ALTER TABLE `#__categories` MODIFY `alias` varchar(400) NOT NULL DEFAULT '';
+ALTER TABLE `#__content_types` MODIFY `type_alias` varchar(400) NOT NULL DEFAULT '';
+ALTER TABLE `#__finder_links` MODIFY `title` varchar(400) DEFAULT NULL;
ALTER TABLE `#__contact_details` MODIFY `alias` varchar(400) NOT NULL DEFAULT '';
ALTER TABLE `#__content` MODIFY `alias` varchar(400) NOT NULL DEFAULT '';
ALTER TABLE `#__menu` MODIFY `alias` varchar(400) NOT NULL COMMENT 'The SEF alias of the menu item.';
ALTER TABLE `#__newsfeeds` MODIFY `alias` varchar(400) NOT NULL DEFAULT '';
+ALTER TABLE `#__tags` MODIFY `path` varchar(400) NOT NULL DEFAULT '';
ALTER TABLE `#__tags` MODIFY `alias` varchar(400) NOT NULL DEFAULT '';
+ALTER TABLE `#__ucm_content` MODIFY `core_type_alias` varchar(400) NOT NULL DEFAULT '' COMMENT 'FK to the content types table';
+ALTER TABLE `#__ucm_content` MODIFY `core_title` varchar(400) NOT NULL;
ALTER TABLE `#__ucm_content` MODIFY `core_alias` varchar(400) NOT NULL DEFAULT '';
+ALTER TABLE `#__users` MODIFY `name` varchar(400) NOT NULL DEFAULT '';
--
--- Step 2.3: Convert all tables to utf8mb4 chracter set with utf8mb4_unicode_ci collation
+-- Step 2.2: Convert all tables to utf8mb4 chracter set with utf8mb4_unicode_ci collation
-- except #__finder_xxx tables, those will have utf8mb4_general_ci collation.
-- Note: The database driver for mysql will change utf8mb4 to utf8 if utf8mb4 is not supported
--
@@ -111,7 +121,7 @@ ALTER TABLE `#__utf8_conversion` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb
ALTER TABLE `#__viewlevels` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
--
--- Step 2.4: Set collation to utf8mb4_bin for formerly utf8_bin collated columns
+-- Step 2.3: Set collation to utf8mb4_bin for formerly utf8_bin collated columns
-- and for the lang_code column of the languages table
--
@@ -126,7 +136,7 @@ ALTER TABLE `#__tags` MODIFY `alias` varchar(400) CHARACTER SET utf8mb4 COLLATE
ALTER TABLE `#__ucm_content` MODIFY `core_alias` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '';
--
--- Step 2.5: Set default character set and collation for all tables
+-- Step 2.4: Set default character set and collation for all tables
--
ALTER TABLE `#__assets` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
@@ -197,3 +207,24 @@ ALTER TABLE `#__user_profiles` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_uni
ALTER TABLE `#__user_usergroup_map` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `#__utf8_conversion` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `#__viewlevels` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
+
+--
+-- Step 2.5: Limit indexes to first 100 so their max allowed lengths would not get exceeded with utf8mb4
+--
+
+ALTER TABLE `#__banners` ADD KEY `idx_metakey_prefix` (`metakey_prefix`(100));
+ALTER TABLE `#__banner_clients` ADD KEY `idx_metakey_prefix` (`metakey_prefix`(100));
+ALTER TABLE `#__categories` ADD KEY `idx_path` (`path`(100));
+ALTER TABLE `#__categories` ADD KEY `idx_alias` (`alias`(100));
+ALTER TABLE `#__content_types` ADD KEY `idx_alias` (`type_alias`(100));
+ALTER TABLE `#__finder_links` ADD KEY `idx_title` (`title`(100));
+ALTER TABLE `#__menu` ADD KEY `idx_alias` (`alias`(100));
+ALTER TABLE `#__menu` ADD UNIQUE `idx_client_id_parent_id_alias_language` (`client_id`,`parent_id`,`alias`(100),`language`);
+ALTER TABLE `#__menu` ADD KEY `idx_path` (`path`(100));
+ALTER TABLE `#__redirect_links` ADD KEY `idx_old_url` (`old_url`(100));
+ALTER TABLE `#__tags` ADD KEY `idx_path` (`path`(100));
+ALTER TABLE `#__tags` ADD KEY `idx_alias` (`alias`(100));
+ALTER TABLE `#__ucm_content` ADD KEY `idx_alias` (`core_alias`(100));
+ALTER TABLE `#__ucm_content` ADD KEY `idx_title` (`core_title`(100));
+ALTER TABLE `#__ucm_content` ADD KEY `idx_content_type` (`core_type_alias`(100));
+ALTER TABLE `#__users` ADD KEY `idx_name` (`name`(100));
diff --git a/administrator/components/com_admin/sql/updates/mysql/2.5.0-2011-12-24.sql b/administrator/components/com_admin/sql/updates/mysql/2.5.0-2011-12-24.sql
index 8f7014c7014f2..bbaaff3f6193c 100644
--- a/administrator/components/com_admin/sql/updates/mysql/2.5.0-2011-12-24.sql
+++ b/administrator/components/com_admin/sql/updates/mysql/2.5.0-2011-12-24.sql
@@ -1,3 +1,8 @@
ALTER TABLE `#__menu` DROP INDEX `idx_client_id_parent_id_alias`;
-ALTER TABLE `#__menu` ADD UNIQUE `idx_client_id_parent_id_alias_language` ( `client_id` , `parent_id` , `alias` , `language` );
\ No newline at end of file
+--
+-- The following statment had to be modified for utf8mb4 in Joomla! 3.5.1, changing
+-- `alias` to `alias`(100)
+--
+
+ALTER TABLE `#__menu` ADD UNIQUE `idx_client_id_parent_id_alias_language` ( `client_id` , `parent_id` , `alias`(100) , `language` );
\ No newline at end of file
diff --git a/administrator/components/com_admin/sql/updates/mysql/3.5.1-2016-03-25.sql b/administrator/components/com_admin/sql/updates/mysql/3.5.1-2016-03-25.sql
new file mode 100644
index 0000000000000..f6c320b8cc24e
--- /dev/null
+++ b/administrator/components/com_admin/sql/updates/mysql/3.5.1-2016-03-25.sql
@@ -0,0 +1,5 @@
+--
+-- Make #__user_keys.user_id fit to #__users.username
+--
+
+ALTER TABLE `#__user_keys` MODIFY `user_id` varchar(150) NOT NULL;
diff --git a/administrator/components/com_admin/sql/updates/mysql/3.5.1-2016-03-29.sql b/administrator/components/com_admin/sql/updates/mysql/3.5.1-2016-03-29.sql
new file mode 100644
index 0000000000000..86ecda89c6258
--- /dev/null
+++ b/administrator/components/com_admin/sql/updates/mysql/3.5.1-2016-03-29.sql
@@ -0,0 +1,7 @@
+--
+-- Reset UTF-8 Multibyte (utf8mb4) or UTF-8 conversion status
+-- to force a new conversion when updating from version 3.5.0
+--
+
+UPDATE `#__utf8_conversion` SET `converted` = 0
+ WHERE (SELECT COUNT(*) FROM `#__schemas` WHERE `extension_id`=700 AND `version_id` LIKE '3.5.0%') = 1;
\ No newline at end of file
diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.1.0.sql b/administrator/components/com_admin/sql/updates/postgresql/3.1.0.sql
index c6df8f526cffa..fe5c364e0a808 100644
--- a/administrator/components/com_admin/sql/updates/postgresql/3.1.0.sql
+++ b/administrator/components/com_admin/sql/updates/postgresql/3.1.0.sql
@@ -47,7 +47,7 @@ CREATE TABLE "#__contentitem_tag_map" (
CONSTRAINT "uc_ItemnameTagid" UNIQUE ("type_alias", "content_item_id", "tag_id")
);
-CREATE INDEX "#__contentitem_tag_map_idx_tag_name" ON "#__contentitem_tag_map" ("tag_id", "type_alias");
+CREATE INDEX "#__contentitem_tag_map_idx_tag_type" ON "#__contentitem_tag_map" ("tag_id", "type_alias");
CREATE INDEX "#__contentitem_tag_map_idx_date_id" ON "#__contentitem_tag_map" ("tag_date", "tag_id");
CREATE INDEX "#__contentitem_tag_map_idx_tag" ON "#__contentitem_tag_map" ("tag_id");
CREATE INDEX "#__contentitem_tag_map_idx_core_content_id" ON "#__contentitem_tag_map" ("core_content_id");
diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.5.0-2015-10-26.sql b/administrator/components/com_admin/sql/updates/postgresql/3.5.0-2015-10-26.sql
index ef806600996c1..05080ce112570 100644
--- a/administrator/components/com_admin/sql/updates/postgresql/3.5.0-2015-10-26.sql
+++ b/administrator/components/com_admin/sql/updates/postgresql/3.5.0-2015-10-26.sql
@@ -1,2 +1,2 @@
-ALTER TABLE "#__contentitem_tag_map" DROP INDEX "#__contentitem_tag_map_idx_tag";
-ALTER TABLE "#__contentitem_tag_map" DROP INDEX "#__contentitem_tag_map_idx_type";
+DROP INDEX "#__contentitem_tag_map_idx_tag";
+DROP INDEX "#__contentitem_tag_map_idx_type";
diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.5.0-2016-03-01.sql b/administrator/components/com_admin/sql/updates/postgresql/3.5.0-2016-03-01.sql
index b7a38334eec57..804efa3edd1dc 100644
--- a/administrator/components/com_admin/sql/updates/postgresql/3.5.0-2016-03-01.sql
+++ b/administrator/components/com_admin/sql/updates/postgresql/3.5.0-2016-03-01.sql
@@ -1,5 +1,5 @@
-ALTER TABLE "#__redirect_links" DROP CONSTRAINT "#__redirect_links_idx_link_old"
-ALTER TABLE "#__redirect_links" ALTER COLUMN "old_url" TYPE varchar(2048);
-ALTER TABLE "#__redirect_links" ALTER COLUMN "new_url" TYPE varchar(2048);
-ALTER TABLE "#__redirect_links" ALTER COLUMN "referer" TYPE varchar(2048);
+ALTER TABLE "#__redirect_links" DROP CONSTRAINT "#__redirect_links_idx_link_old";
+ALTER TABLE "#__redirect_links" ALTER COLUMN "old_url" TYPE character varying(2048);
+ALTER TABLE "#__redirect_links" ALTER COLUMN "new_url" TYPE character varying(2048);
+ALTER TABLE "#__redirect_links" ALTER COLUMN "referer" TYPE character varying(2048);
CREATE INDEX "#__idx_link_old" ON "#__redirect_links" ("old_url");
diff --git a/administrator/components/com_admin/views/sysinfo/tmpl/default_phpsettings.php b/administrator/components/com_admin/views/sysinfo/tmpl/default_phpsettings.php
index 3be760867ba62..6d88f141ff5f8 100644
--- a/administrator/components/com_admin/views/sysinfo/tmpl/default_phpsettings.php
+++ b/administrator/components/com_admin/views/sysinfo/tmpl/default_phpsettings.php
@@ -157,6 +157,14 @@
php_settings['iconv']); ?>
+
+
+
+ |
+
+ php_settings['mcrypt']); ?>
+ |
+
diff --git a/administrator/components/com_admin/views/sysinfo/view.text.php b/administrator/components/com_admin/views/sysinfo/view.text.php
index 13f5b2864d756..e71c9bf622f81 100644
--- a/administrator/components/com_admin/views/sysinfo/view.text.php
+++ b/administrator/components/com_admin/views/sysinfo/view.text.php
@@ -33,6 +33,7 @@ public function display($tpl = null)
return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
}
+ header('Content-Type: text/plain; charset=utf-8');
header('Content-Description: File Transfer');
header('Content-Disposition: attachment; filename="systeminfo-' . date("c") . '.txt"');
header('Cache-Control: must-revalidate');
diff --git a/administrator/components/com_banners/tables/banner.php b/administrator/components/com_banners/tables/banner.php
index 6f9cfa3635826..f853ec9b7619a 100644
--- a/administrator/components/com_banners/tables/banner.php
+++ b/administrator/components/com_banners/tables/banner.php
@@ -92,6 +92,21 @@ public function check()
$this->ordering = self::getNextOrder($this->_db->quoteName('catid') . '=' . $this->_db->quote($this->catid) . ' AND state>=0');
}
+ if (empty($this->publish_up))
+ {
+ $this->publish_up = $this->getDbo()->getNullDate();
+ }
+
+ if (empty($this->publish_down))
+ {
+ $this->publish_down = $this->getDbo()->getNullDate();
+ }
+
+ if (empty($this->modified))
+ {
+ $this->modified = $this->getDbo()->getNullDate();
+ }
+
return true;
}
@@ -178,19 +193,19 @@ public function store($updateNulls = false)
break;
case 2:
$date = JFactory::getDate('+1 year ' . date('Y-m-d', strtotime('now')));
- $this->reset = $this->_db->quote($date->toSql());
+ $this->reset = $date->toSql();
break;
case 3:
$date = JFactory::getDate('+1 month ' . date('Y-m-d', strtotime('now')));
- $this->reset = $this->_db->quote($date->toSql());
+ $this->reset = $date->toSql();
break;
case 4:
$date = JFactory::getDate('+7 day ' . date('Y-m-d', strtotime('now')));
- $this->reset = $this->_db->quote($date->toSql());
+ $this->reset = $date->toSql();
break;
case 5:
$date = JFactory::getDate('+1 day ' . date('Y-m-d', strtotime('now')));
- $this->reset = $this->_db->quote($date->toSql());
+ $this->reset = $date->toSql();
break;
}
diff --git a/administrator/components/com_banners/views/banners/view.html.php b/administrator/components/com_banners/views/banners/view.html.php
index eb76316fca4c8..dc842b884bb39 100644
--- a/administrator/components/com_banners/views/banners/view.html.php
+++ b/administrator/components/com_banners/views/banners/view.html.php
@@ -111,19 +111,19 @@ protected function addToolbar()
if ($canDo->get('core.edit.state'))
{
- if ($this->state->get('filter.state') != 2)
+ if ($this->state->get('filter.published') != 2)
{
JToolbarHelper::publish('banners.publish', 'JTOOLBAR_PUBLISH', true);
JToolbarHelper::unpublish('banners.unpublish', 'JTOOLBAR_UNPUBLISH', true);
}
- if ($this->state->get('filter.state') != -1)
+ if ($this->state->get('filter.published') != -1)
{
- if ($this->state->get('filter.state') != 2)
+ if ($this->state->get('filter.published') != 2)
{
JToolbarHelper::archiveList('banners.archive');
}
- elseif ($this->state->get('filter.state') == 2)
+ elseif ($this->state->get('filter.published') == 2)
{
JToolbarHelper::unarchiveList('banners.publish');
}
@@ -149,7 +149,7 @@ protected function addToolbar()
JToolbar::getInstance('toolbar')->appendButton('Custom', $dhtml, 'batch');
}
- if ($this->state->get('filter.state') == -2 && $canDo->get('core.delete'))
+ if ($this->state->get('filter.published') == -2 && $canDo->get('core.delete'))
{
JToolbarHelper::deleteList('JGLOBAL_CONFIRM_DELETE', 'banners.delete', 'JTOOLBAR_EMPTY_TRASH');
}
diff --git a/administrator/components/com_cache/controller.php b/administrator/components/com_cache/controller.php
index 94606d98fc371..b5db29dc36009 100644
--- a/administrator/components/com_cache/controller.php
+++ b/administrator/components/com_cache/controller.php
@@ -76,18 +76,24 @@ public function delete()
$cid = $this->input->post->get('cid', array(), 'array');
- $model = $this->getModel('cache');
-
if (empty($cid))
{
- JError::raiseWarning(500, JText::_('JERROR_NO_ITEMS_SELECTED'));
+ JFactory::getApplication()->enqueueMessage(JText::_('JERROR_NO_ITEMS_SELECTED'), 'warning');
}
else
{
- $model->cleanlist($cid);
- }
+ $result = $this->getModel('cache')->cleanlist($cid);
- $this->setRedirect('index.php?option=com_cache&client=' . $model->getClient()->id);
+ if ($result !== array())
+ {
+ JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_CACHE_EXPIRED_ITEMS_DELETE_ERROR', implode(', ', $result)), 'error');
+ }
+ else
+ {
+ JFactory::getApplication()->enqueueMessage(JText::_('COM_CACHE_EXPIRED_ITEMS_HAVE_BEEN_DELETED'), 'message');
+ }
+ }
+ $this->setRedirect('index.php?option=com_cache');
}
/**
@@ -100,18 +106,14 @@ public function purge()
// Check for request forgeries
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
- $model = $this->getModel('cache');
- $ret = $model->purge();
-
- $msg = JText::_('COM_CACHE_EXPIRED_ITEMS_HAVE_BEEN_PURGED');
- $msgType = 'message';
-
- if ($ret === false)
+ if (!$this->getModel('cache')->purge())
{
- $msg = JText::_('COM_CACHE_EXPIRED_ITEMS_PURGING_ERROR');
- $msgType = 'error';
+ JFactory::getApplication()->enqueueMessage(JText::_('COM_CACHE_EXPIRED_ITEMS_PURGING_ERROR'), 'error');
}
-
- $this->setRedirect('index.php?option=com_cache&view=purge', $msg, $msgType);
+ else
+ {
+ JFactory::getApplication()->enqueueMessage(JText::_('COM_CACHE_EXPIRED_ITEMS_HAVE_BEEN_PURGED'), 'message');
+ }
+ $this->setRedirect('index.php?option=com_cache&view=purge');
}
}
diff --git a/administrator/components/com_cache/helpers/cache.php b/administrator/components/com_cache/helpers/cache.php
index 034bbb8d697fd..9b9e61e307d93 100644
--- a/administrator/components/com_cache/helpers/cache.php
+++ b/administrator/components/com_cache/helpers/cache.php
@@ -20,6 +20,8 @@ class CacheHelper
* Get a list of filter options for the application clients.
*
* @return array An array of JHtmlOption elements.
+ *
+ * @deprecated 4.0 No replacement.
*/
public static function getClientOptions()
{
diff --git a/administrator/components/com_cache/models/cache.php b/administrator/components/com_cache/models/cache.php
index 6056bdfbe5036..1b592e4a1935c 100644
--- a/administrator/components/com_cache/models/cache.php
+++ b/administrator/components/com_cache/models/cache.php
@@ -185,6 +185,8 @@ public function getCache()
* Method to get client data.
*
* @return array
+ *
+ * @deprecated 4.0 No replacement.
*/
public function getClient()
{
@@ -227,12 +229,11 @@ public function getPagination()
*
* @param string $group Cache group name.
*
- * @return void
+ * @return boolean True on success, false otherwise
*/
public function clean($group = '')
{
- $cache = $this->getCache();
- $cache->clean($group);
+ return $this->getCache()->clean($group);
}
/**
@@ -240,14 +241,21 @@ public function clean($group = '')
*
* @param array $array Array of cache group names.
*
- * @return void
+ * @return array Array with errors, if they exist.
*/
public function cleanlist($array)
{
+ $errors = array();
+
foreach ($array as $group)
{
- $this->clean($group);
+ if (!$this->clean($group))
+ {
+ $errors[] = $group;
+ }
}
+
+ return $errors;
}
/**
@@ -257,8 +265,6 @@ public function cleanlist($array)
*/
public function purge()
{
- $cache = JFactory::getCache('');
-
- return $cache->gc();
+ return JFactory::getCache('')->gc();
}
}
diff --git a/administrator/components/com_categories/models/categories.php b/administrator/components/com_categories/models/categories.php
index afe98851f241a..9567a10fad494 100644
--- a/administrator/components/com_categories/models/categories.php
+++ b/administrator/components/com_categories/models/categories.php
@@ -360,16 +360,48 @@ public function getItems()
{
$extension = $this->getState('filter.extension');
- // Load Helper file of the component for which com_categories displays the categories
- $classname = ucfirst(substr($extension, 4)) . 'Helper';
+ $this->countItems($items, $extension);
+ }
+
+ return $items;
+ }
- if (class_exists($classname) && method_exists($classname, 'countItems'))
+ /**
+ * Method to load the countItems method from the extensions
+ *
+ * @param stdClass[] &$items The category items
+ * @param string $extension The category extension
+ *
+ * @return void
+ *
+ * @since 3.5
+ */
+ public function countItems(&$items, $extension)
+ {
+ $parts = explode('.', $extension);
+ $component = $parts[0];
+ $section = null;
+
+ if (count($parts) > 1)
+ {
+ $section = $parts[1];
+ }
+
+ // Try to find the component helper.
+ $eName = str_replace('com_', '', $component);
+ $file = JPath::clean(JPATH_ADMINISTRATOR . '/components/' . $component . '/helpers/' . $eName . '.php');
+
+ if (file_exists($file))
+ {
+ require_once $file;
+
+ $prefix = ucfirst(str_replace('com_', '', $component));
+ $cName = $prefix . 'Helper';
+
+ if (class_exists($cName) && is_callable(array($cName, 'countItems')))
{
- // Get the SQL to extend the com_category $query object with item count (published, unpublished, trashed)
- $classname::countItems($items);
+ call_user_func(array($cName, 'countItems'), $items, $section);
}
}
-
- return $items;
}
}
diff --git a/administrator/components/com_categories/views/categories/tmpl/default.php b/administrator/components/com_categories/views/categories/tmpl/default.php
index 05ce824cec0df..b565caa7b1b86 100644
--- a/administrator/components/com_categories/views/categories/tmpl/default.php
+++ b/administrator/components/com_categories/views/categories/tmpl/default.php
@@ -9,6 +9,8 @@
defined('_JEXEC') or die;
+use Joomla\String\Inflector;
+
// Include the component HTML helpers.
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
@@ -24,7 +26,22 @@
$listDirn = $this->escape($this->state->get('list.direction'));
$ordering = ($listOrder == 'a.lft');
$saveOrder = ($listOrder == 'a.lft' && strtolower($listDirn) == 'asc');
-$component = $app->input->get('extension');
+$parts = explode('.', $extension);
+$component = $parts[0];
+$section = null;
+
+if (count($parts) > 1)
+{
+ $section = $parts[1];
+
+ $inflector = Inflector::getInstance();
+
+ if (!$inflector->isPlural($section))
+ {
+ $section = $inflector->toPlural($section);
+ }
+}
+
$columns = 7;
if ($saveOrder)
@@ -193,25 +210,25 @@
|
items[0]) && property_exists($this->items[0], 'count_published')) : ?>
- " title="" href="id . '&filter[published]=1' . '&filter[level]=' . (int) $item->level);?>">
+ " title="" href="id . '&filter[published]=1' . '&filter[level]=' . (int) $item->level);?>">
count_published; ?>
|
items[0]) && property_exists($this->items[0], 'count_unpublished')) : ?>
- " title="" href="id . '&filter[published]=0' . '&filter[level]=' . (int) $item->level);?>">
+ " title="" href="id . '&filter[published]=0' . '&filter[level]=' . (int) $item->level);?>">
count_unpublished; ?>
|
items[0]) && property_exists($this->items[0], 'count_archived')) : ?>
- " title="" href="id . '&filter[published]=2' . '&filter[level]=' . (int) $item->level);?>">
+ " title="" href="id . '&filter[published]=2' . '&filter[level]=' . (int) $item->level);?>">
count_archived; ?>
|
items[0]) && property_exists($this->items[0], 'count_trashed')) : ?>
- " title="" href="id . '&filter[published]=-2' . '&filter[level]=' . (int) $item->level);?>">
+ " title="" href="id . '&filter[published]=-2' . '&filter[level]=' . (int) $item->level);?>">
count_trashed; ?>
|
diff --git a/administrator/components/com_config/model/application.php b/administrator/components/com_config/model/application.php
index c546cbba44390..ba9d509739d88 100644
--- a/administrator/components/com_config/model/application.php
+++ b/administrator/components/com_config/model/application.php
@@ -118,6 +118,36 @@ public function save($data)
return false;
}
+ // Check if we can set the Force SSL option
+ if ((int) $data['force_ssl'] !== 0 && (int) $data['force_ssl'] !== (int) JFactory::getConfig()->get('force_ssl', '0'))
+ {
+ try
+ {
+ // Make an HTTPS request to check if the site is available in HTTPS.
+ $host = JUri::getInstance()->getHost();
+ $options = new \Joomla\Registry\Registry;
+ $options->set('userAgent', 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:41.0) Gecko/20100101 Firefox/41.0');
+ $options->set('transport.curl', array(CURLOPT_SSL_VERIFYPEER => false));
+ $response = JHttpFactory::getHttp($options)->get('https://' . $host . JUri::root(true) . '/', array('Host' => $host), 10);
+
+ // If available in HTTPS check also the status code.
+ if (!in_array($response->code, array(200, 503, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310), true))
+ {
+ throw new RuntimeException('HTTPS version of the site returned an invalid HTTP status code.');
+ }
+ }
+ catch (RuntimeException $e)
+ {
+ $data['force_ssl'] = 0;
+
+ // Also update the user state
+ $app->setUserState('com_config.config.global.data.force_ssl', 0);
+
+ // Inform the user
+ $app->enqueueMessage(JText::_('COM_CONFIG_ERROR_SSL_NOT_AVAILABLE'), 'warning');
+ }
+ }
+
// Save the rules
if (isset($data['rules']))
{
diff --git a/administrator/components/com_contact/helpers/contact.php b/administrator/components/com_contact/helpers/contact.php
index b39ea369fc480..8b55524bcbafd 100644
--- a/administrator/components/com_contact/helpers/contact.php
+++ b/administrator/components/com_contact/helpers/contact.php
@@ -63,7 +63,7 @@ public static function countItems(&$items)
$query->select('published AS state, count(*) AS count')
->from($db->qn('#__contact_details'))
->where('catid = ' . (int) $item->id)
- ->group('state');
+ ->group('published');
$db->setQuery($query);
$contacts = $db->loadObjectList();
diff --git a/administrator/components/com_contact/models/contacts.php b/administrator/components/com_contact/models/contacts.php
index e750529ed6195..d400f7195ec32 100644
--- a/administrator/components/com_contact/models/contacts.php
+++ b/administrator/components/com_contact/models/contacts.php
@@ -245,6 +245,7 @@ protected function getListQuery()
'ul.name' ,
'ul.email',
'l.title' ,
+ 'l.image' ,
'uc.name' ,
'ag.title' ,
'c.title'
diff --git a/administrator/components/com_content/models/article.php b/administrator/components/com_content/models/article.php
index ecb9555427681..391808f106cc7 100644
--- a/administrator/components/com_content/models/article.php
+++ b/administrator/components/com_content/models/article.php
@@ -772,4 +772,16 @@ protected function cleanCache($group = null, $client_id = 0)
parent::cleanCache('mod_articles_news');
parent::cleanCache('mod_articles_popular');
}
+
+ /**
+ * Void hit function for pagebreak when editing content from frontend
+ *
+ * @return void
+ *
+ * @since 3.5.2
+ */
+ public function hit()
+ {
+ return;
+ }
}
diff --git a/administrator/components/com_installer/controllers/discover.php b/administrator/components/com_installer/controllers/discover.php
index 2040bad450b13..2670fd8de849d 100644
--- a/administrator/components/com_installer/controllers/discover.php
+++ b/administrator/components/com_installer/controllers/discover.php
@@ -27,7 +27,7 @@ public function refresh()
{
$model = $this->getModel('discover');
$model->discover();
- $this->setRedirect(JRoute::_('index.php?option=com_installer&view=discover', false), $model->_message);
+ $this->setRedirect(JRoute::_('index.php?option=com_installer&view=discover', false));
}
/**
diff --git a/administrator/components/com_installer/models/database.php b/administrator/components/com_installer/models/database.php
index ea580d539bf40..66ac0d92bc0d5 100644
--- a/administrator/components/com_installer/models/database.php
+++ b/administrator/components/com_installer/models/database.php
@@ -42,6 +42,10 @@ protected function populateState($ordering = null, $direction = null)
$this->setState('extension_message', $app->getUserState('com_installer.extension_message'));
$app->setUserState('com_installer.message', '');
$app->setUserState('com_installer.extension_message', '');
+
+ // Prepare the utf8mb4 conversion check table
+ $this->prepareUtf8mb4StatusTable();
+
parent::populateState('name', 'asc');
}
@@ -67,9 +71,16 @@ public function fix()
$installer->deleteUnexistingFiles();
$this->fixDefaultTextFilters();
- // Finally make sure the database is converted to utf8mb4 or, if not suported
- // by the server, compatible to it
- $this->convertTablesToUtf8mb4();
+ /*
+ * Finally, if the schema updates succeeded, make sure the database is
+ * converted to utf8mb4 or, if not suported by the server, compatible to it.
+ */
+ $statusArray = $changeSet->getStatus();
+
+ if (count($statusArray['error']) == 0)
+ {
+ $this->convertTablesToUtf8mb4();
+ }
}
/**
diff --git a/administrator/components/com_installer/views/install/tmpl/default.php b/administrator/components/com_installer/views/install/tmpl/default.php
index 90f50feedd7a3..ec4292e78286c 100644
--- a/administrator/components/com_installer/views/install/tmpl/default.php
+++ b/administrator/components/com_installer/views/install/tmpl/default.php
@@ -51,7 +51,7 @@
var form = document.getElementById("adminForm");
// do field validation
- if (form.install_url.value == "" || form.install_url.value == "http://") {
+ if (form.install_url.value == "" || form.install_url.value == "http://" || form.install_url.value == "https://") {
alert("' . JText::_('COM_INSTALLER_MSG_INSTALL_ENTER_A_URL', true) . '");
}
else
@@ -169,7 +169,7 @@
\ No newline at end of file
+
diff --git a/administrator/components/com_installer/views/warnings/view.html.php b/administrator/components/com_installer/views/warnings/view.html.php
index fa46df366367f..5cee0fc778fa7 100644
--- a/administrator/components/com_installer/views/warnings/view.html.php
+++ b/administrator/components/com_installer/views/warnings/view.html.php
@@ -32,6 +32,15 @@ public function display($tpl = null)
$items = $this->get('Items');
$this->messages = &$items;
parent::display($tpl);
+
+ if (count($items) > 0)
+ {
+ JFactory::getApplication()->enqueueMessage(JText::_('COM_INSTALLER_MSG_WARNINGS_NOTICE'), 'warning');
+ }
+ else
+ {
+ JFactory::getApplication()->enqueueMessage(JText::_('COM_INSTALLER_MSG_WARNINGS_NONE'), 'notice');
+ }
}
/**
diff --git a/administrator/components/com_joomlaupdate/restore_finalisation.php b/administrator/components/com_joomlaupdate/restore_finalisation.php
new file mode 100644
index 0000000000000..12ea98c878bf1
--- /dev/null
+++ b/administrator/components/com_joomlaupdate/restore_finalisation.php
@@ -0,0 +1,190 @@
+unlink($fileName);
+ }
+ }
+}
+
+// Fake the JFolder class, mapping it to Restore's post-processing class
+if (!class_exists('JFolder'))
+{
+ /**
+ * JFolder mock class proxing behaviour in the post-upgrade script to that of either native PHP or restore.php
+ *
+ * @since 3.5.1
+ */
+ abstract class JFolder
+ {
+ /**
+ * Proxies checking a folder exists to the native php version
+ *
+ * @param string $folderName The path to the folder to be checked
+ *
+ * @return bool
+ *
+ * @since 3.5.1
+ */
+ public static function exists($folderName)
+ {
+ return @is_dir($folderName);
+ }
+
+ /**
+ * Proxies deleting a folder to the restore.php version
+ *
+ * @param string $folderName The path to the folder to be deleted
+ *
+ * @return void
+ *
+ * @since 3.5.1
+ */
+ public static function delete($folderName)
+ {
+ recursive_remove_directory($folderName);
+ }
+ }
+}
+
+// Fake the JText class - we aren't going to show errors to people anyhow
+if (!class_exists('JText'))
+{
+ /**
+ * JText mock class proxing behaviour in the post-upgrade script to that of either native PHP or restore.php
+ *
+ * @since 3.5.1
+ */
+ abstract class JText
+ {
+ /**
+ * No need for translations in a non-interactive script, so always return an empty string here
+ *
+ * @param string $text A language constant
+ *
+ * @return string
+ *
+ * @since 3.5.1
+ */
+ public static function sprintf($text)
+ {
+ return '';
+ }
+ }
+}
+
+if (!function_exists('finalizeRestore'))
+{
+ /**
+ * Run part of the Joomla! finalisation script, namely the part that cleans up unused files/folders
+ *
+ * @param string $siteRoot The root to the Joomla! site
+ * @param string $restorePath The base path to restore.php
+ *
+ * @return void
+ *
+ * @since 3.5.1
+ */
+ function finalizeRestore($siteRoot, $restorePath)
+ {
+ if (!defined('JPATH_ROOT'))
+ {
+ define('JPATH_ROOT', $siteRoot);
+ }
+
+ $filePath = JPATH_ROOT . '/administrator/components/com_admin/script.php';
+
+ if (file_exists($filePath))
+ {
+ require_once ($filePath);
+ }
+
+ // Make sure Joomla!'s code can figure out which files exist and need be removed
+ clearstatcache();
+
+ // Remove obsolete files - prevents errors occuring in some system plugins
+ if (class_exists('JoomlaInstallerScript'))
+ {
+ $script = new JoomlaInstallerScript;
+ $script->deleteUnexistingFiles();
+ }
+
+ // Clear OPcache
+ if (function_exists('opcache_reset'))
+ {
+ opcache_reset();
+ }
+ elseif (function_exists('apc_clear_cache'))
+ {
+ @apc_clear_cache();
+ }
+ }
+}
diff --git a/administrator/components/com_languages/helpers/multilangstatus.php b/administrator/components/com_languages/helpers/multilangstatus.php
index 9509cbbc47e00..71d7b54754257 100644
--- a/administrator/components/com_languages/helpers/multilangstatus.php
+++ b/administrator/components/com_languages/helpers/multilangstatus.php
@@ -143,19 +143,65 @@ public static function getStatus()
public static function getContacts()
{
$db = JFactory::getDbo();
+ $languages = count(JLanguageHelper::getLanguages());
+
+ // Get the number of contact with all as language
+ $alang = $db->getQuery(true)
+ ->select('count(*)')
+ ->from('#__contact_details AS cd')
+ ->where('cd.user_id=u.id')
+ ->where('cd.published=1')
+ ->where('cd.language=' . $db->quote('*'));
+
+ // Get the number of languages for the contact
+ $slang = $db->getQuery(true)
+ ->select('count(distinct(l.lang_code))')
+ ->from('#__languages as l')
+ ->join('LEFT', '#__contact_details AS cd ON cd.language=l.lang_code')
+ ->where('cd.user_id=u.id')
+ ->where('cd.published=1')
+ ->where('l.published=1');
+
+ // Get the number of multiple contact/language
+ $mlang = $db->getQuery(true)
+ ->select('count(*)')
+ ->from('#__languages as l')
+ ->join('LEFT', '#__contact_details AS cd ON cd.language=l.lang_code')
+ ->where('cd.user_id=u.id')
+ ->where('cd.published=1')
+ ->where('l.published=1')
+ ->group('l.lang_code')
+ ->having('count(*) > 1');
+
+ // Get the contacts
$query = $db->getQuery(true)
- ->select('u.name, count(cd.language) as counted, MAX(cd.language=' . $db->quote('*') . ') as all_languages')
+ ->select('u.name, (' . $alang . ') as alang, (' . $slang . ') as slang, (' . $mlang . ') as mlang')
->from('#__users AS u')
->join('LEFT', '#__contact_details AS cd ON cd.user_id=u.id')
- ->join('LEFT', '#__languages as l on cd.language=l.lang_code')
- ->where('EXISTS (SELECT * from #__content as c where c.created_by=u.id)')
- ->where('(l.published=1 or cd.language=' . $db->quote('*') . ')')
- ->where('cd.published=1')
- ->group('u.id')
- ->having('(counted !=' . count(JLanguageHelper::getLanguages()) . ' OR all_languages=1)')
- ->having('(counted !=1 OR all_languages=0)');
- $db->setQuery($query);
+ ->where('EXISTS (SELECT 1 from #__content as c where c.created_by=u.id)')
+ ->group('u.id');
- return $db->loadObjectList();
+ $db->setQuery($query);
+ $warnings = $db->loadObjectList();
+
+ foreach ($warnings as $index => $warn)
+ {
+ if (($warn->alang == 1) && ($warn->slang == 0))
+ {
+ unset($warnings[$index]);
+ }
+
+ if (($warn->alang == 0) && (($warn->slang == 0) && (empty($warn->mlang))))
+ {
+ unset($warnings[$index]);
+ }
+
+ if (($warn->alang == 0) && (($warn->slang == $languages) && (empty($warn->mlang))))
+ {
+ unset($warnings[$index]);
+ }
+ }
+
+ return $warnings;
}
}
diff --git a/administrator/components/com_languages/views/language/tmpl/edit.php b/administrator/components/com_languages/views/language/tmpl/edit.php
index 2bea8dd94df7d..68a578764777f 100644
--- a/administrator/components/com_languages/views/language/tmpl/edit.php
+++ b/administrator/components/com_languages/views/language/tmpl/edit.php
@@ -40,7 +40,7 @@
);
?>
-