diff --git a/.appveyor.yml b/.appveyor.yml index d8fb063b7af86..7bbd2ee4f0c3d 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -33,13 +33,13 @@ install: $VC = "vc14" $PHPBuild = "x64" } - - cinst -y sqlite + - appveyor-retry cinst -y sqlite - cd C:\tools\php # Get the MSSQL DLL's - ps: >- If ($env:PHP -eq "1") { If ($env:php_ver_target -eq "5.6") { - appveyor DownloadFile https://files.nette.org/misc/php-sqlsrv.zip + appveyor-retry appveyor DownloadFile https://cdn.joomla.org/ci/php-sqlsrv.zip 7z x -y php-sqlsrv.zip > $null copy SQLSRV\php_sqlsrv_56_nts.dll ext\php_sqlsrv_nts.dll copy SQLSRV\php_pdo_sqlsrv_56_nts.dll ext\php_pdo_sqlsrv_nts.dll @@ -83,7 +83,7 @@ install: If ($env:PHP -eq "1") { If ($env:php_ver_target -eq "5.6") {$wincache = "1.3.7.12"} Else {$wincache = "2.0.0.8"} cd c:\tools\php\ext - appveyor DownloadFile http://windows.php.net/downloads/pecl/releases/wincache/$($wincache)/php_wincache-$($wincache)-$($env:php_ver_target)-nts-$($VC)-$($PHPBuild).zip + appveyor-retry appveyor DownloadFile http://windows.php.net/downloads/pecl/releases/wincache/$($wincache)/php_wincache-$($wincache)-$($env:php_ver_target)-nts-$($VC)-$($PHPBuild).zip 7z x -y php_wincache-$($wincache)-$($env:php_ver_target)-nts-$($VC)-$($PHPBuild).zip > $null Remove-Item C:\tools\php\ext* -include .zip cd c:\tools\php} diff --git a/.gitignore b/.gitignore index bbfb1deaa049f..fe2b19d07b093 100644 --- a/.gitignore +++ b/.gitignore @@ -36,6 +36,16 @@ phpdoc-* # Install from Web plugin # /plugins/installer/webinstaller +# Languages # +administrator/language/* +!administrator/language/en-GB +administrator/manifests/packages/* +!administrator/manifests/packages/pkg_en-GB.xml +!administrator/language/overrides/index.html +language/* +!language/en-GB +!language/overrides/index.html + # OSX # ._* .Spotlight-V100 @@ -95,9 +105,13 @@ Desktop.ini /libraries/vendor/paragonie/random_compat/other /libraries/vendor/paragonie/random_compat/CHANGELOG.md /libraries/vendor/paragonie/random_compat/ERRATA.md +/libraries/vendor/paragonie/random_compat/RATIONALE.md /libraries/vendor/paragonie/random_compat/README.md /libraries/vendor/paragonie/random_compat/SECURITY.md +/libraries/vendor/paragonie/random_compat/build-phar.sh /libraries/vendor/paragonie/random_compat/composer.json +/libraries/vendor/paragonie/random_compat/psalm-autoload.php +/libraries/vendor/paragonie/random_compat/psalm.xml /libraries/vendor/paragonie/random_compat/tests /libraries/vendor/phpmailer/phpmailer/docs /libraries/vendor/phpmailer/phpmailer/examples diff --git a/.travis.yml b/.travis.yml index 8595f2f766792..14dae27f2374f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,10 @@ env: matrix: fast_finish: true include: + - 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: 7.1 + 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: 5.3 env: INSTALL_APC="yes" - php: 5.4 @@ -21,27 +25,6 @@ matrix: env: INSTALL_APCU="yes" - php: 5.6 env: 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: 7.1 - 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 - sudo: true - dist: trusty - group: edge # until the next update - addons: - apt: - packages: - - mysql-server-5.6 - - mysql-client-core-5.6 - - mysql-client-5.6 - services: - - mysql - - postgresql - - redis-server - env: INSTALL_APCU_BC_BETA="no" INSTALL_MEMCACHE="no" INSTALL_MEMCACHED="no" # Disabled items that currently do not work in travis-ci hhvm - allow_failures: - - php: hhvm services: - memcache diff --git a/README.md b/README.md index 00e0c5964b458..2b631d9f72d89 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ What is this? --------------------- * This is a Joomla! 3.x installation/upgrade package. * Joomla's [Official website](https://www.joomla.org). -* Joomla! 3.7 [version history](https://docs.joomla.org/Joomla_3.7_version_history). +* Joomla! 3.7 [version history](https://docs.joomla.org/Special:MyLanguage/Joomla_3.7_version_history). * Detailed changes are in the [changelog](https://github.com/joomla/joomla-cms/commits/master). What is Joomla? @@ -26,20 +26,20 @@ What is Joomla? Is Joomla! for you? --------------------- -* Joomla! is [the right solution for most content web projects](https://docs.joomla.org/Portal:Learn_More). +* Joomla! is [the right solution for most content web projects](https://docs.joomla.org/Special:MyLanguage/Portal:Learn_More). * View Joomla's [core features here](https://www.joomla.org/core-features.html). * Try it out for yourself in our [online demo](https://demo.joomla.org). How to find a Joomla! translation? --------------------- * Repository of [accredited language packs](https://community.joomla.org/translations.html). -* You can also [add languages](https://docs.joomla.org/J3.x:Setup_a_Multilingual_Site/Installing_New_Language) directly to your website via your Joomla! administration panel. -* Learn how to [setup a Multilingual Joomla! Site](https://docs.joomla.org/J3.x:Setup_a_Multilingual_Site) +* You can also [add languages](https://docs.joomla.org/Special:MyLanguage/J3.x:Setup_a_Multilingual_Site/Installing_New_Language) directly to your website via your Joomla! administration panel. +* Learn how to [setup a Multilingual Joomla! Site](https://docs.joomla.org/Special:MyLanguage/J3.x:Setup_a_Multilingual_Site) Learn Joomla! --------------------- -* Read ['Getting Started with Joomla!'](https://docs.joomla.org/J3.x:Getting_Started_with_Joomla!) to learn the basics. -* Before installing, read the ['Beginners' Guide'](https://docs.joomla.org/Portal:Beginners). +* Read ['Getting Started with Joomla!'](https://docs.joomla.org/Special:MyLanguage/J3.x:Getting_Started_with_Joomla!) to learn the basics. +* Before installing, read the ['Beginners' Guide'](https://docs.joomla.org/Special:MyLanguage/Portal:Beginners). What are the benefits of Joomla? --------------------- @@ -51,13 +51,13 @@ Is it easy to change the layout display? --------------------- * The layout is controlled by templates that you can edit. * There are a lot of ready-made professional templates that you can download. -* Template management information is [available here](https://docs.joomla.org/Portal:Template_Management). +* Template management information is [available here](https://docs.joomla.org/Special:MyLanguage/Portal:Template_Management). Ready to install Joomla? --------------------- * Check the [minimum requirements](https://downloads.joomla.org/technical-requirements). -* How do you [install Joomla](https://docs.joomla.org/J3.x:Installing_Joomla)? -* You could start your Joomla! experience by [building your site on a local test server](https://docs.joomla.org/Installing_Joomla_locally). +* How do you [install Joomla](https://docs.joomla.org/Special:MyLanguage/J3.x:Installing_Joomla)? +* You could start your Joomla! experience by [building your site on a local test server](https://docs.joomla.org/Special:MyLanguage/Installing_Joomla_locally). When ready, it can be moved to an online hosting account of your choice. Updates are free! @@ -66,9 +66,9 @@ Updates are free! Where can you get support and help? --------------------- -* [The Joomla! Documentation](https://docs.joomla.org/Main_Page); -* [Frequently Asked Questions](https://docs.joomla.org/Category:FAQ) (FAQ); -* Find the [information you need](https://docs.joomla.org/Start_here); +* [The Joomla! Documentation](https://docs.joomla.org/Special:MyLanguage/Main_Page); +* [Frequently Asked Questions](https://docs.joomla.org/Special:MyLanguage/Category:FAQ) (FAQ); +* Find the [information you need](https://docs.joomla.org/Special:MyLanguage/Start_here); * Find [help and other users](https://www.joomla.org/about-joomla/create-and-share.html); * Post questions at [our forums](https://forum.joomla.org); * [Joomla Resources Directory](https://resources.joomla.org/) (JRD). @@ -76,21 +76,21 @@ Where can you get support and help? Do you already have a Joomla! site that isn't built with Joomla! 3.x? --------------------- * What's [new in Joomla! 3.x](https://www.joomla.org/3)? -* What are the [main differences between 2.5 and 3.x](https://docs.joomla.org/What_are_the_major_differences_between_Joomla!_2.5_and_3.x%3F)? -* How to [migrate from 2.5.x to 3.x](https://docs.joomla.org/Joomla_2.5_to_3.x_Step_by_Step_Migration). -* How to [migrate from 1.5.x to 3.x](https://docs.joomla.org/Joomla_1.5_to_3.x_Step_by_Step_Migration). +* What are the [main differences between 2.5 and 3.x](https://docs.joomla.org/Special:MyLanguage/What_are_the_major_differences_between_Joomla!_2.5_and_3.x%3F)? +* How to [migrate from 2.5.x to 3.x](https://docs.joomla.org/Special:MyLanguage/Joomla_2.5_to_3.x_Step_by_Step_Migration). +* How to [migrate from 1.5.x to 3.x](https://docs.joomla.org/Special:MyLanguage/Joomla_1.5_to_3.x_Step_by_Step_Migration). Do you want to improve Joomla? -------------------- * Where to [request a feature](https://issues.joomla.org/)? -* How do you [report a bug](https://docs.joomla.org/Filing_bugs_and_issues) on the [Issue Tracker](https://issues.joomla.org/)? +* How do you [report a bug](https://docs.joomla.org/Special:MyLanguage/Filing_bugs_and_issues) on the [Issue Tracker](https://issues.joomla.org/)? * Get Involved: Joomla! is community developed software. [Join the community](https://volunteers.joomla.org/). -* Documentation for [Developers](https://docs.joomla.org/Portal:Developers). -* Documentation for [Web designers](https://docs.joomla.org/Web_designers). +* Documentation for [Developers](https://docs.joomla.org/Special:MyLanguage/Portal:Developers). +* Documentation for [Web designers](https://docs.joomla.org/Special:MyLanguage/Web_designers). Copyright --------------------- * Copyright (C) 2005 - 2017 Open Source Matters. All rights reserved. -* [Special Thanks](https://docs.joomla.org/Joomla!_Credits_and_Thanks) +* [Special Thanks](https://docs.joomla.org/Special:MyLanguage/Joomla!_Credits_and_Thanks) * Distributed under the GNU General Public License version 2 or later -* See [License details](https://docs.joomla.org/Joomla_Licenses) +* See [License details](https://docs.joomla.org/Special:MyLanguage/Joomla_Licenses) diff --git a/README.txt b/README.txt index 9881b46597896..a9c9c1789e1cf 100644 --- a/README.txt +++ b/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.7 version history - https://docs.joomla.org/Joomla_3.7_version_history + * Joomla! 3.7 version history - https://docs.joomla.org/Special:MyLanguage/Joomla_3.7_version_history * Detailed changes in the Changelog: https://github.com/joomla/joomla-cms/commits/master 2- What is Joomla? @@ -11,18 +11,18 @@ You can find full technical requirements here: https://downloads.joomla.org/technical-requirements. 3- Is Joomla! for you? - * Joomla! is the right solution for most content web projects: https://docs.joomla.org/Portal:Learn_More + * Joomla! is the right solution for most content web projects: https://docs.joomla.org/Special:MyLanguage/Portal:Learn_More * See Joomla's core features - https://www.joomla.org/core-features.html * Try out our online demo: https://demo.joomla.org/ 4- How to find a Joomla! translation? * Repository of accredited language packs: https://community.joomla.org/translations.html - * You can also add languages directly to your website via your Joomla! administration panel: https://docs.joomla.org/J3.x:Setup_a_Multilingual_Site/Installing_New_Language - * Learn how to setup a Multilingual Joomla! Site: https://docs.joomla.org/J3.x:Setup_a_Multilingual_Site + * You can also add languages directly to your website via your Joomla! administration panel: https://docs.joomla.org/Special:MyLanguage/J3.x:Setup_a_Multilingual_Site/Installing_New_Language + * Learn how to setup a Multilingual Joomla! Site: https://docs.joomla.org/Special:MyLanguage/J3.x:Setup_a_Multilingual_Site 5- Learn Joomla! - * Read Getting Started with Joomla to find out the basics: https://docs.joomla.org/J3.x:Getting_Started_with_Joomla! - * Before installing, read the beginners guide: https://docs.joomla.org/Portal:Beginners + * Read Getting Started with Joomla to find out the basics: https://docs.joomla.org/Special:MyLanguage/J3.x:Getting_Started_with_Joomla! + * Before installing, read the beginners guide: https://docs.joomla.org/Special:MyLanguage/Portal:Beginners 6- What are the benefits of Joomla? * The functionality of a Joomla! website can be extended by installing extensions that you can create (or download) to suit your needs. @@ -32,41 +32,41 @@ 7- Is it easy to change the layout display? * The layout is controlled by templates that you can edit. * There are a lot of ready-made professional templates that you can download. - * Check out the template management information: https://docs.joomla.org/Portal:Template_Management + * Check out the template management information: https://docs.joomla.org/Special:MyLanguage/Portal:Template_Management 8- Ready to install Joomla? * Check the minimum requirements here: https://downloads.joomla.org/technical-requirements - * How do you install Joomla - https://docs.joomla.org/J3.x:Installing_Joomla + * How do you install Joomla - https://docs.joomla.org/Special:MyLanguage/J3.x:Installing_Joomla * You could start your Joomla! experience building your site on a local test server. When ready it can be moved to an online hosting account of your choice. - See the tutorial: https://docs.joomla.org/Installing_Joomla_locally + See the tutorial: https://docs.joomla.org/Special:MyLanguage/Installing_Joomla_locally 9- Updates are free! * Always use the latest version: https://downloads.joomla.org/latest 10- Where can you get support and help? - * The Joomla! Documentation: https://docs.joomla.org/Main_Page - * FAQ Frequently Asked Questions: https://docs.joomla.org/Category:FAQ - * Find the information you need: https://docs.joomla.org/Start_here + * The Joomla! Documentation: https://docs.joomla.org/Special:MyLanguage/Main_Page + * FAQ Frequently Asked Questions: https://docs.joomla.org/Special:MyLanguage/Category:FAQ + * Find the information you need: https://docs.joomla.org/Special:MyLanguage/Start_here * Find help and other users: https://www.joomla.org/about-joomla/create-and-share.html * Post questions at our forums: https://forum.joomla.org * Joomla! Resources Directory (JRD): https://resources.joomla.org/ 11- Do you already have a Joomla! site that's not built with Joomla! 3.x ? * What's new in Joomla! 3.x: https://www.joomla.org/3 - * What are the main differences from 2.5 to 3? https://docs.joomla.org/What_are_the_major_differences_between_Joomla!_2.5_and_3.x%3F - * How to migrate from 2.5.x to 3.x? Tutorial: https://docs.joomla.org/Joomla_2.5_to_3.x_Step_by_Step_Migration - * How to migrate from 1.5.x to 3.x? Tutorial: https://docs.joomla.org/Joomla_1.5_to_3.x_Step_by_Step_Migration + * What are the main differences from 2.5 to 3? https://docs.joomla.org/Special:MyLanguage/What_are_the_major_differences_between_Joomla!_2.5_and_3.x%3F + * How to migrate from 2.5.x to 3.x? Tutorial: https://docs.joomla.org/Special:MyLanguage/Joomla_2.5_to_3.x_Step_by_Step_Migration + * How to migrate from 1.5.x to 3.x? Tutorial: https://docs.joomla.org/Special:MyLanguage/Joomla_1.5_to_3.x_Step_by_Step_Migration 12- Do you want to improve Joomla? * Where to request a feature? https://issues.joomla.org/ - * How do you report a bug? https://docs.joomla.org/Filing_bugs_and_issues + * How do you report a bug? https://docs.joomla.org/Special:MyLanguage/Filing_bugs_and_issues * Get Involved: Joomla! is a community developed software. Join the community at https://volunteers.joomla.org/ - * Documentation for Developers: https://docs.joomla.org/Portal:Developers - * Documentation for Web designers: https://docs.joomla.org/Web_designers + * Documentation for Developers: https://docs.joomla.org/Special:MyLanguage/Portal:Developers + * Documentation for Web designers: https://docs.joomla.org/Special:MyLanguage/Web_designers Copyright: * Copyright (C) 2005 - 2017 Open Source Matters. All rights reserved. - * Special Thanks: https://docs.joomla.org/Joomla!_Credits_and_Thanks + * Special Thanks: https://docs.joomla.org/Special:MyLanguage/Joomla!_Credits_and_Thanks * Distributed under the GNU General Public License version 2 or later - * See Licenses details at https://docs.joomla.org/Joomla_Licenses + * See Licenses details at https://docs.joomla.org/Special:MyLanguage/Joomla_Licenses diff --git a/administrator/components/com_admin/models/sysinfo.php b/administrator/components/com_admin/models/sysinfo.php index c8d8850f46558..b2c9ea6ed1abf 100644 --- a/administrator/components/com_admin/models/sysinfo.php +++ b/administrator/components/com_admin/models/sysinfo.php @@ -482,18 +482,13 @@ public function getExtensions() 'authorUrl' => 'unknown', ); - $manifest = json_decode($extension->manifest_cache); - - if (!$manifest instanceof stdClass) - { - continue; - } + $manifest = new Registry($extension->manifest_cache); $extraData = array( - 'author' => $manifest->author, - 'version' => $manifest->version, - 'creationDate' => $manifest->creationDate, - 'authorUrl' => $manifest->authorUrl, + 'author' => $manifest->get('author', ''), + 'version' => $manifest->get('version', ''), + 'creationDate' => $manifest->get('creationDate', ''), + 'authorUrl' => $manifest->get('authorUrl', '') ); $installed[$extension->name] = array_merge($installed[$extension->name], $extraData); diff --git a/administrator/components/com_admin/postinstall/joomla40checks.php b/administrator/components/com_admin/postinstall/joomla40checks.php index 7f921fa3629e7..c55571c29015e 100644 --- a/administrator/components/com_admin/postinstall/joomla40checks.php +++ b/administrator/components/com_admin/postinstall/joomla40checks.php @@ -18,7 +18,7 @@ * * @since 3.7 * - * @see https://developer.joomla.org/news/658-joomla4-manifesto.html + * @link https://developer.joomla.org/news/658-joomla4-manifesto.html */ function admin_postinstall_joomla40checks_condition() { diff --git a/administrator/components/com_admin/postinstall/languageaccess340.php b/administrator/components/com_admin/postinstall/languageaccess340.php index 86186a95d355d..d55964eb122dd 100644 --- a/administrator/components/com_admin/postinstall/languageaccess340.php +++ b/administrator/components/com_admin/postinstall/languageaccess340.php @@ -15,8 +15,8 @@ /** * Checks if the installation is affected by the issue with content languages access in 3.4.0 * - * @see https://github.com/joomla/joomla-cms/pull/6172 - * @see https://github.com/joomla/joomla-cms/pull/6194 + * @link https://github.com/joomla/joomla-cms/pull/6172 + * @link https://github.com/joomla/joomla-cms/pull/6194 * * @return boolean * diff --git a/administrator/components/com_admin/postinstall/phpversion.php b/administrator/components/com_admin/postinstall/phpversion.php deleted file mode 100644 index 7e1a4aec28533..0000000000000 --- a/administrator/components/com_admin/postinstall/phpversion.php +++ /dev/null @@ -1,24 +0,0 @@ - 0 THEN MAX(p.published) ELSE MIN(p.published) END AS newPublished FROM `#__categories` AS `c2` @@ -6,6 +7,7 @@ UPDATE `#__categories` AS `c` INNER JOIN ( ON c.id = c2.id SET published = c2.newPublished; +UPDATE `#__menu` SET `published` = 1 WHERE `alias` = 'root'; UPDATE `#__menu` AS `c` INNER JOIN ( SELECT c2.id, CASE WHEN MIN(p.published) > 0 THEN MAX(p.published) ELSE MIN(p.published) END AS newPublished FROM `#__menu` AS `c2` diff --git a/administrator/components/com_admin/sql/updates/mysql/3.7.0-2017-04-19.sql b/administrator/components/com_admin/sql/updates/mysql/3.7.0-2017-04-19.sql new file mode 100644 index 0000000000000..35327661646c8 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/3.7.0-2017-04-19.sql @@ -0,0 +1,3 @@ +-- Set integer field default values. +UPDATE `#__extensions` SET `params` = '{"multiple":"0","first":"1","last":"100","step":"1"}' WHERE `name` = 'plg_fields_integer'; + diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2016-08-29.sql b/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2016-08-29.sql index 1515c80895030..1676d972db1fa 100644 --- a/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2016-08-29.sql +++ b/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2016-08-29.sql @@ -66,12 +66,12 @@ CREATE TABLE "#__fields_groups" ( "access" bigint DEFAULT 0 NOT NULL, PRIMARY KEY ("id") ); -CREATE INDEX "#__fields_idx_checked_out" ON "#__fields_groups" ("checked_out"); -CREATE INDEX "#__fields_idx_state" ON "#__fields_groups" ("state"); -CREATE INDEX "#__fields_idx_created_by" ON "#__fields_groups" ("created_by"); -CREATE INDEX "#__fields_idx_access" ON "#__fields_groups" ("access"); -CREATE INDEX "#__fields_idx_context" ON "#__fields_groups" ("context"); -CREATE INDEX "#__fields_idx_language" ON "#__fields_groups" ("language"); +CREATE INDEX "#__fields_groups_idx_checked_out" ON "#__fields_groups" ("checked_out"); +CREATE INDEX "#__fields_groups_idx_state" ON "#__fields_groups" ("state"); +CREATE INDEX "#__fields_groups_idx_created_by" ON "#__fields_groups" ("created_by"); +CREATE INDEX "#__fields_groups_idx_access" ON "#__fields_groups" ("access"); +CREATE INDEX "#__fields_groups_idx_context" ON "#__fields_groups" ("context"); +CREATE INDEX "#__fields_groups_idx_language" ON "#__fields_groups" ("language"); -- -- Table: #__fields_values diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2017-03-09.sql b/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2017-03-09.sql index 109609388f86a..08aa07b95e254 100644 --- a/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2017-03-09.sql +++ b/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2017-03-09.sql @@ -1,3 +1,4 @@ +UPDATE "#__categories" SET published = 1 WHERE alias = 'root'; UPDATE "#__categories" AS "c" SET published = c2.newPublished FROM ( @@ -7,6 +8,7 @@ INNER JOIN "#__categories" AS "p" ON p.lft <= c2.lft AND c2.rgt <= p.rgt GROUP BY c2.id) AS c2 WHERE c2.id = c.id; +UPDATE "#__menu" SET published = 1 WHERE alias = 'root'; UPDATE "#__menu" AS "c" SET published = c2.newPublished FROM ( diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2017-04-19.sql b/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2017-04-19.sql new file mode 100644 index 0000000000000..5df4318cc3680 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2017-04-19.sql @@ -0,0 +1,2 @@ +-- Set integer field default values. +UPDATE `#__extensions` SET `params` = '{"multiple":"0","first":"1","last":"100","step":"1"}' WHERE `name` = 'plg_fields_integer'; diff --git a/administrator/components/com_admin/sql/updates/sqlazure/3.7.0-2017-03-09.sql b/administrator/components/com_admin/sql/updates/sqlazure/3.7.0-2017-03-09.sql index d250fb881f58a..feb0fc106b9f7 100644 --- a/administrator/components/com_admin/sql/updates/sqlazure/3.7.0-2017-03-09.sql +++ b/administrator/components/com_admin/sql/updates/sqlazure/3.7.0-2017-03-09.sql @@ -1,3 +1,4 @@ +UPDATE "#__categories" SET published = 1 WHERE alias = 'root'; UPDATE "c" SET published = c2.newPublished FROM "#__categories" AS "c" @@ -7,6 +8,7 @@ FROM "#__categories" AS "c2" INNER JOIN "#__categories" AS "p" ON p.lft <= c2.lft AND c2.rgt <= p.rgt GROUP BY c2.id) AS c2 ON c2.id = c.id; +UPDATE "#__menu" SET published = 1 WHERE alias = 'root'; UPDATE "c" SET published = c2.newPublished FROM "#__menu" AS "c" diff --git a/administrator/components/com_admin/sql/updates/sqlazure/3.7.0-2017-04-19.sql b/administrator/components/com_admin/sql/updates/sqlazure/3.7.0-2017-04-19.sql new file mode 100644 index 0000000000000..042487bcbc4d3 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/sqlazure/3.7.0-2017-04-19.sql @@ -0,0 +1,3 @@ +-- Set integer field default values. +UPDATE [#__extensions] SET [params] = '{"multiple":"0","first":"1","last":"100","step":"1"}' WHERE [name] = 'plg_fields_integer'; + diff --git a/administrator/components/com_admin/views/profile/view.html.php b/administrator/components/com_admin/views/profile/view.html.php index d23010b43fe92..fbe3e3747f3cd 100644 --- a/administrator/components/com_admin/views/profile/view.html.php +++ b/administrator/components/com_admin/views/profile/view.html.php @@ -58,9 +58,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } $this->form->setValue('password', null); diff --git a/administrator/components/com_admin/views/sysinfo/view.html.php b/administrator/components/com_admin/views/sysinfo/view.html.php index fc1a93a1bf795..b406ed27f8885 100644 --- a/administrator/components/com_admin/views/sysinfo/view.html.php +++ b/administrator/components/com_admin/views/sysinfo/view.html.php @@ -70,7 +70,7 @@ public function display($tpl = null) // Access check. if (!JFactory::getUser()->authorise('core.admin')) { - return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR')); + throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403); } $this->php_settings = $this->get('PhpSettings'); diff --git a/administrator/components/com_admin/views/sysinfo/view.json.php b/administrator/components/com_admin/views/sysinfo/view.json.php index 92455c573581b..4d7a9b7c08eed 100644 --- a/administrator/components/com_admin/views/sysinfo/view.json.php +++ b/administrator/components/com_admin/views/sysinfo/view.json.php @@ -30,7 +30,7 @@ public function display($tpl = null) // Access check. if (!JFactory::getUser()->authorise('core.admin')) { - return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR')); + throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403); } header('MIME-Version: 1.0'); diff --git a/administrator/components/com_admin/views/sysinfo/view.text.php b/administrator/components/com_admin/views/sysinfo/view.text.php index f284e2cf3e6b7..d90a045be1c35 100644 --- a/administrator/components/com_admin/views/sysinfo/view.text.php +++ b/administrator/components/com_admin/views/sysinfo/view.text.php @@ -30,7 +30,7 @@ public function display($tpl = null) // Access check. if (!JFactory::getUser()->authorise('core.admin')) { - return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR')); + throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403); } header('Content-Type: text/plain; charset=utf-8'); diff --git a/administrator/components/com_associations/controllers/association.php b/administrator/components/com_associations/controllers/association.php index 69fb8c7371a24..60d5234559b58 100644 --- a/administrator/components/com_associations/controllers/association.php +++ b/administrator/components/com_associations/controllers/association.php @@ -31,9 +31,9 @@ class AssociationsControllerAssociation extends JControllerForm */ public function edit($key = null, $urlVar = null) { - list($extensionName, $typeName) = explode('.', $this->input->get('itemtype')); + list($extensionName, $typeName) = explode('.', $this->input->get('itemtype', '', 'string')); - $id = $this->input->get('id', 0); + $id = $this->input->get('id', 0, 'int'); // Check if reference item can be edited. if (!AssociationsHelper::allowEdit($extensionName, $typeName, $id)) @@ -52,7 +52,7 @@ public function edit($key = null, $urlVar = null) * * @param string $key The name of the primary key of the URL variable. * - * @return void. + * @return void * * @since 3.7.0 */ @@ -60,7 +60,7 @@ public function cancel($key = null) { JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); - list($extensionName, $typeName) = explode('.', $this->input->get('itemtype')); + list($extensionName, $typeName) = explode('.', $this->input->get('itemtype', '', 'string')); // Only check in, if component item type allows to check out. if (AssociationsHelper::typeSupportsCheckout($extensionName, $typeName)) @@ -73,7 +73,7 @@ public function cancel($key = null) $ids = array_unique(explode(',', $targetId)); } - $ids[] = $this->input->get('id', 0); + $ids[] = $this->input->get('id', 0, 'int'); foreach ($ids as $key => $id) { diff --git a/administrator/components/com_associations/controllers/associations.php b/administrator/components/com_associations/controllers/associations.php index 8ec6606574b6b..23cbb6d04908e 100644 --- a/administrator/components/com_associations/controllers/associations.php +++ b/administrator/components/com_associations/controllers/associations.php @@ -68,4 +68,63 @@ public function clean() $this->getModel('associations')->clean(); $this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list, false)); } + + /** + * Method to check in an item from the association item overview. + * + * @return void + * + * @since 3.7.1 + */ + public function checkin() + { + // Set the redirect so we can just stop processing when we find a condition we can't process + $this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list, false)); + + // Figure out if the item supports checking and check it in + $type = null; + + list($extensionName, $typeName) = explode('.', $this->input->get('itemtype')); + + $extension = AssociationsHelper::getSupportedExtension($extensionName); + $types = $extension->get('types'); + + if (!array_key_exists($typeName, $types)) + { + return; + } + + if (AssociationsHelper::typeSupportsCheckout($extensionName, $typeName) === false) + { + // How on earth we came to that point, eject internet + return; + } + + $cid = $this->input->get('cid', array(), 'array'); + + if (empty($cid)) + { + // Seems we don't have an id to work with. + return; + } + + // We know the first element is the one we need because we don't allow multi selection of rows + $id = $cid[0]; + + if (AssociationsHelper::canCheckinItem($extensionName, $typeName, $id) === true) + { + $item = AssociationsHelper::getItem($extensionName, $typeName, $id); + + $item->checkIn($id); + + return; + } + + $this->setRedirect( + JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list), + JText::_('COM_ASSOCIATIONS_YOU_ARE_NOT_ALLOWED_TO_CHECKIN_THIS_ITEM') + ); + + return; + } } diff --git a/administrator/components/com_associations/helpers/associations.php b/administrator/components/com_associations/helpers/associations.php index 02bb2c2d3a0aa..38b9193b8a2cf 100644 --- a/administrator/components/com_associations/helpers/associations.php +++ b/administrator/components/com_associations/helpers/associations.php @@ -641,4 +641,33 @@ public static function getTypeFieldName($extensionName, $typeName, $fieldName) return $helper->getTypeFieldName($typeName, $fieldName); } + + /** + * Gets the language filter system plugin extension id. + * + * @return int The language filter system plugin extension id. + * + * @since 3.7.2 + */ + public static function getLanguagefilterPluginId() + { + $db = JFactory::getDbo(); + $query = $db->getQuery(true) + ->select($db->quoteName('extension_id')) + ->from($db->quoteName('#__extensions')) + ->where($db->quoteName('folder') . ' = ' . $db->quote('system')) + ->where($db->quoteName('element') . ' = ' . $db->quote('languagefilter')); + $db->setQuery($query); + + try + { + $result = (int) $db->loadResult(); + } + catch (RuntimeException $e) + { + JError::raiseWarning(500, $e->getMessage()); + } + + return $result; + } } diff --git a/administrator/components/com_associations/models/associations.php b/administrator/components/com_associations/models/associations.php index 03a3696e3d78e..67114f93fbcf0 100644 --- a/administrator/components/com_associations/models/associations.php +++ b/administrator/components/com_associations/models/associations.php @@ -151,7 +151,6 @@ protected function getStoreId($id = '') protected function getListQuery() { $type = null; - $listOrdering = $this->getState('list.fullordering'); list($extensionName, $typeName) = explode('.', $this->state->get('itemtype')); @@ -403,11 +402,11 @@ protected function getListQuery() // Add the group by clause $query->group($db->qn($groupby)); - // Add the list ordering clause. - if (!empty($listOrdering)) - { - $query->order($db->escape($listOrdering)); - } + // Add the list ordering clause + $listOrdering = $this->state->get('list.ordering', 'id'); + $orderDirn = $this->state->get('list.direction', 'ASC'); + + $query->order($db->escape($listOrdering) . ' ' . $db->escape($orderDirn)); return $query; } diff --git a/administrator/components/com_associations/models/fields/itemlanguage.php b/administrator/components/com_associations/models/fields/itemlanguage.php index 04bbafd7948d3..459a91a7c2c6f 100644 --- a/administrator/components/com_associations/models/fields/itemlanguage.php +++ b/administrator/components/com_associations/models/fields/itemlanguage.php @@ -40,7 +40,7 @@ protected function getOptions() { $input = JFactory::getApplication()->input; - list($extensionName, $typeName) = explode('.', $input->get('itemtype')); + list($extensionName, $typeName) = explode('.', $input->get('itemtype', '', 'string')); // Get the extension specific helper method $helper = AssociationsHelper::getExtensionHelper($extensionName); diff --git a/administrator/components/com_associations/models/fields/modalassociation.php b/administrator/components/com_associations/models/fields/modalassociation.php index 64371e85df692..5f2278dc70b5f 100644 --- a/administrator/components/com_associations/models/fields/modalassociation.php +++ b/administrator/components/com_associations/models/fields/modalassociation.php @@ -95,8 +95,8 @@ protected function getInput() 'width' => '800px', 'bodyHeight' => '70', 'modalWidth' => '80', - 'footer' => '', + 'footer' => '', ) ); diff --git a/administrator/components/com_associations/views/association/tmpl/edit.php b/administrator/components/com_associations/views/association/tmpl/edit.php index ced7000ad5d54..d4e6b689a5c78 100644 --- a/administrator/components/com_associations/views/association/tmpl/edit.php +++ b/administrator/components/com_associations/views/association/tmpl/edit.php @@ -22,7 +22,7 @@ 'id' => $this->referenceId, ); ?> - diff --git a/administrator/components/com_associations/views/association/view.html.php b/administrator/components/com_associations/views/association/view.html.php index 4d77a8d7ef012..00bdcb4467b72 100644 --- a/administrator/components/com_associations/views/association/view.html.php +++ b/administrator/components/com_associations/views/association/view.html.php @@ -62,6 +62,7 @@ class AssociationsViewAssociation extends JViewLegacy * @return void * * @since 3.7.0 + * @throws Exception */ public function display($tpl = null) { @@ -69,8 +70,6 @@ public function display($tpl = null) if (count($errors = $this->get('Errors'))) { throw new Exception(implode("\n", $errors), 500); - - return false; } $this->app = JFactory::getApplication(); @@ -78,7 +77,7 @@ public function display($tpl = null) $input = $this->app->input; $this->referenceId = $input->get('id', 0, 'int'); - list($extensionName, $typeName) = explode('.', $input->get('itemtype')); + list($extensionName, $typeName) = explode('.', $input->get('itemtype', '', 'string')); $extension = AssociationsHelper::getSupportedExtension($extensionName); $types = $extension->get('types'); @@ -135,7 +134,7 @@ public function display($tpl = null) $this->targetId = $matches[1]; $this->targetLanguage = $matches[0]; $task = $typeName . '.' . $this->targetAction; - $this->defaultTargetSrc = JRoute::_($this->editUri . '&task= ' . $task . ' &id=' . (int) $this->targetId); + $this->defaultTargetSrc = JRoute::_($this->editUri . '&task=' . $task . '&id=' . (int) $this->targetId); $this->form->setValue('itemlanguage', '', $this->targetLanguage . ':' . $this->targetId . ':' . $this->targetAction); } @@ -198,13 +197,13 @@ protected function addToolbar() $bar->appendButton( 'Custom', '', 'reference' ); $bar->appendButton( 'Custom', '', 'target' ); diff --git a/administrator/components/com_associations/views/associations/tmpl/default.php b/administrator/components/com_associations/views/associations/tmpl/default.php index 9b6dbaa6893c5..b00dd9f74f10c 100644 --- a/administrator/components/com_associations/views/associations/tmpl/default.php +++ b/administrator/components/com_associations/views/associations/tmpl/default.php @@ -16,7 +16,7 @@ JHtml::_('behavior.multiselect'); JHtml::_('formbehavior.chosen', 'select'); -$listOrder = $this->escape($this->state->get('list.fullordering')); +$listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); $canManageCheckin = JFactory::getUser()->authorise('core.manage', 'com_checkin'); $colSpan = 5; @@ -110,7 +110,6 @@ items as $i => $item) : - $canCheckin = true; $canEdit = AssociationsHelper::allowEdit($this->extensionName, $this->typeName, $item->id); $canCheckin = $canManageCheckin || AssociationsHelper::canCheckinItem($this->extensionName, $this->typeName, $item->id); $isCheckout = AssociationsHelper::isCheckoutItem($this->extensionName, $this->typeName, $item->id); @@ -122,9 +121,13 @@ + id); ?> level)) : ?> $item->level)); ?> + + editor, $item->checked_out_time, 'associations.'); ?> + editor, $item->checked_out_time, 'associations.', $canCheckin); ?> @@ -173,6 +176,7 @@ + diff --git a/administrator/components/com_associations/views/associations/tmpl/modal.php b/administrator/components/com_associations/views/associations/tmpl/modal.php index 2a5d2755000fe..1fec625cdad28 100644 --- a/administrator/components/com_associations/views/associations/tmpl/modal.php +++ b/administrator/components/com_associations/views/associations/tmpl/modal.php @@ -21,10 +21,12 @@ JHtml::_('behavior.multiselect'); JHtml::_('formbehavior.chosen', 'select'); -$function = $app->input->getCmd('function', 'jSelectAssociation'); -$listOrder = $this->escape($this->state->get('list.ordering')); -$listDirn = $this->escape($this->state->get('list.direction')); -$colSpan = 4; +$function = $app->input->getCmd('function', 'jSelectAssociation'); +$listOrder = $this->escape($this->state->get('list.ordering')); +$listDirn = $this->escape($this->state->get('list.direction')); +$canManageCheckin = JFactory::getUser()->authorise('core.manage', 'com_checkin'); +$colSpan = 4; + $iconStates = array( -2 => 'icon-trash', 0 => 'icon-unpublish', @@ -102,6 +104,9 @@ items as $i => $item) : + $canEdit = AssociationsHelper::allowEdit($this->extensionName, $this->typeName, $item->id); + $canCheckin = $canManageCheckin || AssociationsHelper::canCheckinItem($this->extensionName, $this->typeName, $item->id); + $isCheckout = AssociationsHelper::isCheckoutItem($this->extensionName, $this->typeName, $item->id); ?> typeSupports['state'])) : ?> @@ -113,7 +118,17 @@ level)) : ?> $item->level)); ?> - escape($item->title); ?> + + + escape($item->title); ?> + + editor, $item->checked_out_time, 'associations.'); ?> + + escape($item->title); ?> + + + escape($item->title); ?> + typeFields['alias'])) : ?> escape($item->alias)); ?> diff --git a/administrator/components/com_associations/views/associations/view.html.php b/administrator/components/com_associations/views/associations/view.html.php index 5c82f82b483d5..ce481471ab11a 100644 --- a/administrator/components/com_associations/views/associations/view.html.php +++ b/administrator/components/com_associations/views/associations/view.html.php @@ -69,7 +69,8 @@ public function display($tpl = null) if (!JLanguageAssociations::isEnabled()) { - JFactory::getApplication()->enqueueMessage(JText::_('COM_ASSOCIATIONS_ERROR_NO_ASSOC'), 'warning'); + $link = JRoute::_('index.php?option=com_plugins&task=plugin.edit&extension_id=' . AssociationsHelper::getLanguagefilterPluginId()); + JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_ASSOCIATIONS_ERROR_NO_ASSOC', $link), 'warning'); } elseif ($this->state->get('itemtype') == '' || $this->state->get('language') == '') { diff --git a/administrator/components/com_banners/controllers/tracks.raw.php b/administrator/components/com_banners/controllers/tracks.raw.php index 146ef47c0bc95..ebf4970d56bf2 100644 --- a/administrator/components/com_banners/controllers/tracks.raw.php +++ b/administrator/components/com_banners/controllers/tracks.raw.php @@ -79,12 +79,31 @@ public function display($cachable = false, $urlparams = array()) $model->setState('basename', $form['basename']); $model->setState('compressed', $form['compressed']); - $config = JFactory::getConfig(); - $cookie_domain = $config->get('cookie_domain', ''); - $cookie_path = $config->get('cookie_path', '/'); + // Create one year cookies. + $cookieLifeTime = time() + 365 * 86400; + $cookieDomain = $app->get('cookie_domain', ''); + $cookiePath = $app->get('cookie_path', '/'); + $isHttpsForced = $app->isHttpsForced(); - setcookie(JApplicationHelper::getHash($this->context . '.basename'), $form['basename'], time() + 365 * 86400, $cookie_path, $cookie_domain); - setcookie(JApplicationHelper::getHash($this->context . '.compressed'), $form['compressed'], time() + 365 * 86400, $cookie_path, $cookie_domain); + $app->input->cookie->set( + JApplicationHelper::getHash($this->context . '.basename'), + $form['basename'], + $cookieLifeTime, + $cookiePath, + $cookieDomain, + $isHttpsForced, + true + ); + + $app->input->cookie->set( + JApplicationHelper::getHash($this->context . '.compressed'), + $form['compressed'], + $cookieLifeTime, + $cookiePath, + $cookieDomain, + $isHttpsForced, + true + ); // Push the model into the view (as default). $view->setModel($model, true); diff --git a/administrator/components/com_banners/views/banner/view.html.php b/administrator/components/com_banners/views/banner/view.html.php index 503ab2b4f03e2..56d98cf202f4c 100644 --- a/administrator/components/com_banners/views/banner/view.html.php +++ b/administrator/components/com_banners/views/banner/view.html.php @@ -56,9 +56,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } $this->addToolbar(); diff --git a/administrator/components/com_banners/views/banners/tmpl/default.php b/administrator/components/com_banners/views/banners/tmpl/default.php index faacb3bfedeba..57b41549cb1dc 100644 --- a/administrator/components/com_banners/views/banners/tmpl/default.php +++ b/administrator/components/com_banners/views/banners/tmpl/default.php @@ -111,7 +111,7 @@ + value="ordering; ?>" class="width-20 text-area-order" /> diff --git a/administrator/components/com_banners/views/banners/view.html.php b/administrator/components/com_banners/views/banners/view.html.php index d954cff9ccb0e..a4bafbf6c267b 100644 --- a/administrator/components/com_banners/views/banners/view.html.php +++ b/administrator/components/com_banners/views/banners/view.html.php @@ -65,9 +65,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } BannersHelper::addSubmenu('banners'); diff --git a/administrator/components/com_banners/views/client/view.html.php b/administrator/components/com_banners/views/client/view.html.php index ab0975e8acc1e..f4f0005104af4 100644 --- a/administrator/components/com_banners/views/client/view.html.php +++ b/administrator/components/com_banners/views/client/view.html.php @@ -63,9 +63,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } $this->addToolbar(); diff --git a/administrator/components/com_banners/views/clients/view.html.php b/administrator/components/com_banners/views/clients/view.html.php index efdc218fc5df4..ae0034b9a35b9 100644 --- a/administrator/components/com_banners/views/clients/view.html.php +++ b/administrator/components/com_banners/views/clients/view.html.php @@ -57,9 +57,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } BannersHelper::addSubmenu('clients'); diff --git a/administrator/components/com_banners/views/download/view.html.php b/administrator/components/com_banners/views/download/view.html.php index a4b0a4243a313..a963d6ec1a5aa 100644 --- a/administrator/components/com_banners/views/download/view.html.php +++ b/administrator/components/com_banners/views/download/view.html.php @@ -37,9 +37,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } return parent::display($tpl); diff --git a/administrator/components/com_banners/views/tracks/view.html.php b/administrator/components/com_banners/views/tracks/view.html.php index 32887e9947e8a..cd93b888975f6 100644 --- a/administrator/components/com_banners/views/tracks/view.html.php +++ b/administrator/components/com_banners/views/tracks/view.html.php @@ -57,9 +57,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } BannersHelper::addSubmenu('tracks'); diff --git a/administrator/components/com_banners/views/tracks/view.raw.php b/administrator/components/com_banners/views/tracks/view.raw.php index 918fca9583554..f9babb40b0596 100644 --- a/administrator/components/com_banners/views/tracks/view.raw.php +++ b/administrator/components/com_banners/views/tracks/view.raw.php @@ -33,9 +33,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } $document = JFactory::getDocument(); diff --git a/administrator/components/com_cache/views/cache/view.html.php b/administrator/components/com_cache/views/cache/view.html.php index 35e56171b5751..d61cb7927463d 100644 --- a/administrator/components/com_cache/views/cache/view.html.php +++ b/administrator/components/com_cache/views/cache/view.html.php @@ -47,9 +47,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } $this->addToolbar(); diff --git a/administrator/components/com_categories/helpers/categories.php b/administrator/components/com_categories/helpers/categories.php index da87beab3b9da..3103328d8b8a7 100644 --- a/administrator/components/com_categories/helpers/categories.php +++ b/administrator/components/com_categories/helpers/categories.php @@ -152,7 +152,7 @@ public static function validateCategoryId($catid, $extension) * * @param array $data Array of data for new category. * - * @return integer. + * @return integer */ public static function createCategory($data) { diff --git a/administrator/components/com_categories/models/fields/categoryedit.php b/administrator/components/com_categories/models/fields/categoryedit.php index be7220b4ab1cf..a972f26ddd396 100644 --- a/administrator/components/com_categories/models/fields/categoryedit.php +++ b/administrator/components/com_categories/models/fields/categoryedit.php @@ -41,7 +41,7 @@ class JFormFieldCategoryEdit extends JFormFieldList * * @param SimpleXMLElement $element The SimpleXMLElement object representing the tag for the form field object. * @param mixed $value The form field value to validate. - * @param string $group The field name group control value. This acts as as an array container for the field. + * @param string $group The field name group control value. This acts as an array container for the field. * For example if the field has name="foo" and the group value is set to "bar" then the * full field name would end up being "bar[foo]". * diff --git a/administrator/components/com_categories/models/forms/category.xml b/administrator/components/com_categories/models/forms/category.xml index 1b41ed27ac806..cad1b4196ca5b 100644 --- a/administrator/components/com_categories/models/forms/category.xml +++ b/administrator/components/com_categories/models/forms/category.xml @@ -25,6 +25,8 @@ name="asset_id" type="hidden" filter="unset" + label="JFIELD_ASSET_ID_LABEL" + description="JFIELD_ASSET_ID_DESC" /> get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } // Preprocess the list of items to find ordering divisions. diff --git a/administrator/components/com_categories/views/category/view.html.php b/administrator/components/com_categories/views/category/view.html.php index 2f635cee631ed..22fd60d296c98 100644 --- a/administrator/components/com_categories/views/category/view.html.php +++ b/administrator/components/com_categories/views/category/view.html.php @@ -70,9 +70,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } // Check for tag type diff --git a/administrator/components/com_checkin/views/checkin/view.html.php b/administrator/components/com_checkin/views/checkin/view.html.php index 4594dbd113411..2943c79484d5e 100644 --- a/administrator/components/com_checkin/views/checkin/view.html.php +++ b/administrator/components/com_checkin/views/checkin/view.html.php @@ -71,9 +71,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } $this->addToolbar(); diff --git a/administrator/components/com_config/model/application.php b/administrator/components/com_config/model/application.php index 1b3474735037b..17fc3f0fad3da 100644 --- a/administrator/components/com_config/model/application.php +++ b/administrator/components/com_config/model/application.php @@ -283,7 +283,7 @@ public function save($data) * Look for a custom cache_path * First check if a path is given in the submitted data, then check if a path exists in the previous data, otherwise use the default */ - if ($data['cache_path']) + if (!empty($data['cache_path'])) { $path = $data['cache_path']; } @@ -564,120 +564,101 @@ public function storePermissions($permission = null) try { - // Load the current settings for this component. - $query = $this->db->getQuery(true) - ->select($this->db->quoteName(array('name', 'rules'))) - ->from($this->db->quoteName('#__assets')) - ->where($this->db->quoteName('name') . ' = ' . $this->db->quote($permission['component'])); - - $this->db->setQuery($query); - - // Load the results as a list of stdClass objects (see later for more options on retrieving data). - $results = $this->db->loadAssocList(); - } - catch (Exception $e) - { - $app->enqueueMessage($e->getMessage(), 'error'); - - return false; - } - - // No record found, let's create one. - if (empty($results)) - { - $data = array(); - $data[$permission['action']] = array($permission['rule'] => $permission['value']); + $asset = JTable::getInstance('asset'); + $result = $asset->loadByName($permission['component']); - $rules = new JAccessRules($data); - $asset = JTable::getInstance('asset'); - $asset->rules = (string) $rules; - $asset->name = (string) $permission['component']; - $asset->title = (string) $permission['title']; - - // Get the parent asset id so we have a correct tree. - $parentAsset = JTable::getInstance('Asset'); - - if (strpos($asset->name, '.') !== false) + if ($result === false) { - $assetParts = explode('.', $asset->name); - $parentAsset->loadByName($assetParts[0]); - $parentAssetId = $parentAsset->id; - } - else - { - $parentAssetId = $parentAsset->getRootId(); - } - - /** - * @to do: incorrect ACL stored - * When changing a permission of an item that doesn't have a row in the asset table the row a new row is created. - * This works fine for item <-> component <-> global config scenario and component <-> global config scenario. - * But doesn't work properly for item <-> section(s) <-> component <-> global config scenario, - * because a wrong parent asset id (the component) is stored. - * Happens when there is no row in the asset table (ex: deleted or not created on update). - */ + $data = array($permission['action'] => array($permission['rule'] => $permission['value'])); - $asset->setLocation($parentAssetId, 'last-child'); - - if (!$asset->check() || !$asset->store()) - { - $app->enqueueMessage(JText::_('JLIB_UNKNOWN'), 'error'); + $rules = new JAccessRules($data); + $asset->rules = (string) $rules; + $asset->name = (string) $permission['component']; + $asset->title = (string) $permission['title']; - return false; - } - } - else - { - // Decode the rule settings. - $temp = json_decode($results[0]['rules'], true); + // Get the parent asset id so we have a correct tree. + $parentAsset = JTable::getInstance('Asset'); - // Check if a new value is to be set. - if (isset($permission['value'])) - { - // Check if we already have an action entry. - if (!isset($temp[$permission['action']])) + if (strpos($asset->name, '.') !== false) { - $temp[$permission['action']] = array(); + $assetParts = explode('.', $asset->name); + $parentAsset->loadByName($assetParts[0]); + $parentAssetId = $parentAsset->id; } - - // Check if we already have a rule entry. - if (!isset($temp[$permission['action']][$permission['rule']])) + else { - $temp[$permission['action']][$permission['rule']] = array(); + $parentAssetId = $parentAsset->getRootId(); } - // Set the new permission. - $temp[$permission['action']][$permission['rule']] = (int) $permission['value']; + /** + * @to do: incorrect ACL stored + * When changing a permission of an item that doesn't have a row in the asset table the row a new row is created. + * This works fine for item <-> component <-> global config scenario and component <-> global config scenario. + * But doesn't work properly for item <-> section(s) <-> component <-> global config scenario, + * because a wrong parent asset id (the component) is stored. + * Happens when there is no row in the asset table (ex: deleted or not created on update). + */ - // Check if we have an inherited setting. - if (strlen($permission['value']) === 0) - { - unset($temp[$permission['action']][$permission['rule']]); - } + $asset->setLocation($parentAssetId, 'last-child'); } else { - // There is no value so remove the action as it's not needed. - unset($temp[$permission['action']]); - } + // Decode the rule settings. + $temp = json_decode($asset->rules, true); - // Store the new permissions. - try - { - $query->clear() - ->update($this->db->quoteName('#__assets')) - ->set($this->db->quoteName('rules') . ' = ' . $this->db->quote(json_encode($temp))) - ->where($this->db->quoteName('name') . ' = ' . $this->db->quote($permission['component'])); + // Check if a new value is to be set. + if (isset($permission['value'])) + { + // Check if we already have an action entry. + if (!isset($temp[$permission['action']])) + { + $temp[$permission['action']] = array(); + } + + // Check if we already have a rule entry. + if (!isset($temp[$permission['action']][$permission['rule']])) + { + $temp[$permission['action']][$permission['rule']] = array(); + } + + // Set the new permission. + $temp[$permission['action']][$permission['rule']] = (int) $permission['value']; + + // Check if we have an inherited setting. + if ($permission['value'] === '') + { + unset($temp[$permission['action']][$permission['rule']]); + } + + // Check if we have any rules. + if (!$temp[$permission['action']]) + { + unset($temp[$permission['action']]); + } + } + else + { + // There is no value so remove the action as it's not needed. + unset($temp[$permission['action']]); + } - $this->db->setQuery($query)->execute(); + $asset->rules = json_encode($temp, JSON_FORCE_OBJECT); } - catch (Exception $e) + + if (!$asset->check() || !$asset->store()) { - $app->enqueueMessage($e->getMessage(), 'error'); + $app->enqueueMessage(JText::_('JLIB_UNKNOWN'), 'error'); return false; } } + catch (Exception $e) + { + $app->enqueueMessage($e->getMessage(), 'error'); + + return false; + } + // All checks done. $result = array( @@ -691,7 +672,7 @@ public function storePermissions($permission = null) try { // Get the asset id by the name of the component. - $query->clear() + $query = $this->db->getQuery(true) ->select($this->db->quoteName('id')) ->from($this->db->quoteName('#__assets')) ->where($this->db->quoteName('name') . ' = ' . $this->db->quote($permission['component'])); diff --git a/administrator/components/com_config/model/form/application.xml b/administrator/components/com_config/model/form/application.xml index 2f965fe43d503..a620e7993fa9b 100644 --- a/administrator/components/com_config/model/form/application.xml +++ b/administrator/components/com_config/model/form/application.xml @@ -1190,6 +1190,11 @@ title="JACTION_ADMIN_GLOBAL" description="COM_CONFIG_ACTION_ADMIN_DESC" /> + form->getFieldset($name) as $field) : ?> - + type === 'Spacer' ? ' field-spacer' : ''; + ?> showon) : ?> 'auto', 'relative' => true)); ?> @@ -87,7 +90,7 @@ hidden) : ?> input; ?> -
> +
>
label; ?> diff --git a/administrator/components/com_contact/config.xml b/administrator/components/com_contact/config.xml index 3683321c4073f..3bc8da197b319 100644 --- a/administrator/components/com_contact/config.xml +++ b/administrator/components/com_contact/config.xml @@ -112,7 +112,7 @@ > - + JHIDE + + + + + getError()); } + + if ($value == 1) + { + $message = JText::plural('COM_CONTACT_N_ITEMS_FEATURED', count($ids)); + } + else + { + $message = JText::plural('COM_CONTACT_N_ITEMS_UNFEATURED', count($ids)); + } } - $this->setRedirect('index.php?option=com_contact&view=contacts'); + $this->setRedirect('index.php?option=com_contact&view=contacts', $message); } /** diff --git a/administrator/components/com_contact/helpers/html/contact.php b/administrator/components/com_contact/helpers/html/contact.php index aff48320506c3..52a9814fd53df 100644 --- a/administrator/components/com_contact/helpers/html/contact.php +++ b/administrator/components/com_contact/helpers/html/contact.php @@ -114,12 +114,13 @@ public static function featured($value = 0, $i, $canChange = true) if ($canChange) { $html = ''; + . ($value == 1 ? ' active' : '') . '" title="' . JHtml::_('tooltipText', $state[3]) + . '">'; } else { - $html = ''; + $html = ''; } return $html; diff --git a/administrator/components/com_contact/models/forms/contact.xml b/administrator/components/com_contact/models/forms/contact.xml index f697a5f1cbc4e..1f539b28a1b82 100644 --- a/administrator/components/com_contact/models/forms/contact.xml +++ b/administrator/components/com_contact/models/forms/contact.xml @@ -530,6 +530,18 @@ + + + + + +
+ +
+ +
+
+
diff --git a/administrator/components/com_contact/views/contact/view.html.php b/administrator/components/com_contact/views/contact/view.html.php index de63c695b8827..57d367bf16b4a 100644 --- a/administrator/components/com_contact/views/contact/view.html.php +++ b/administrator/components/com_contact/views/contact/view.html.php @@ -54,9 +54,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } // If we are forcing a language in modal (used for associations). diff --git a/administrator/components/com_contact/views/contacts/tmpl/default.php b/administrator/components/com_contact/views/contacts/tmpl/default.php index a50ecd75adc81..a83c32b787fc3 100644 --- a/administrator/components/com_contact/views/contacts/tmpl/default.php +++ b/administrator/components/com_contact/views/contacts/tmpl/default.php @@ -115,7 +115,7 @@ + value="ordering; ?>" class="width-20 text-area-order" /> diff --git a/administrator/components/com_contact/views/contacts/view.html.php b/administrator/components/com_contact/views/contacts/view.html.php index 81a2a48b2251c..05978bf3ebd62 100644 --- a/administrator/components/com_contact/views/contacts/view.html.php +++ b/administrator/components/com_contact/views/contacts/view.html.php @@ -81,9 +81,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } // Preprocess the list of items to find ordering divisions. diff --git a/administrator/components/com_content/config.xml b/administrator/components/com_content/config.xml index d467380a479cb..21f34112cb57b 100644 --- a/administrator/components/com_content/config.xml +++ b/administrator/components/com_content/config.xml @@ -350,7 +350,7 @@ type="plugins" label="COM_CONTENT_FIELD_CAPTCHA_LABEL" description="COM_CONTENT_FIELD_CAPTCHA_DESC" - default="0" + default="" folder="captcha" filter="cmd" > @@ -762,6 +762,7 @@
- - + + - - + +
diff --git a/administrator/components/com_content/helpers/content.php b/administrator/components/com_content/helpers/content.php index edd822c453a4c..be806fc1782e1 100644 --- a/administrator/components/com_content/helpers/content.php +++ b/administrator/components/com_content/helpers/content.php @@ -40,6 +40,12 @@ public static function addSubmenu($vName) $vName == 'categories' ); + JHtmlSidebar::addEntry( + JText::_('COM_CONTENT_SUBMENU_FEATURED'), + 'index.php?option=com_content&view=featured', + $vName == 'featured' + ); + if (JComponentHelper::isEnabled('com_fields') && JComponentHelper::getParams('com_content')->get('custom_fields_enable', '1')) { JHtmlSidebar::addEntry( @@ -53,12 +59,6 @@ public static function addSubmenu($vName) $vName == 'fields.groups' ); } - - JHtmlSidebar::addEntry( - JText::_('COM_CONTENT_SUBMENU_FEATURED'), - 'index.php?option=com_content&view=featured', - $vName == 'featured' - ); } /** diff --git a/administrator/components/com_content/helpers/html/contentadministrator.php b/administrator/components/com_content/helpers/html/contentadministrator.php index b3f7bd06dd9e3..f5e8da1c34520 100644 --- a/administrator/components/com_content/helpers/html/contentadministrator.php +++ b/administrator/components/com_content/helpers/html/contentadministrator.php @@ -114,12 +114,13 @@ public static function featured($value = 0, $i, $canChange = true) if ($canChange) { $html = ''; + . ($value == 1 ? ' active' : '') . '" title="' . JHtml::_('tooltipText', $state[3]) + . '">'; } else { $html = ''; + . JHtml::_('tooltipText', $state[2]) . '">'; } return $html; diff --git a/administrator/components/com_content/models/article.php b/administrator/components/com_content/models/article.php index 86daa1e1dae33..b6dba4d0cfefe 100644 --- a/administrator/components/com_content/models/article.php +++ b/administrator/components/com_content/models/article.php @@ -414,7 +414,7 @@ public function getForm($data = array(), $loadData = true) protected function loadFormData() { // Check the session for previously entered form data. - $app = JFactory::getApplication(); + $app = JFactory::getApplication(); $data = $app->getUserState('com_content.edit.article.data', array()); if (empty($data)) @@ -451,6 +451,38 @@ protected function loadFormData() return $data; } + /** + * Method to validate the form data. + * + * @param JForm $form The form to validate against. + * @param array $data The data to validate. + * @param string $group The name of the field group to validate. + * + * @return array|boolean Array of filtered data if valid, false otherwise. + * + * @see JFormRule + * @see JFilterInput + * @since 3.7.0 + */ + public function validate($form, $data, $group = null) + { + // Don't allow to change the users if not allowed to access com_users. + if (JFactory::getApplication()->isClient('administrator') && !JFactory::getUser()->authorise('core.manage', 'com_users')) + { + if (isset($data['created_by'])) + { + unset($data['created_by']); + } + + if (isset($data['modified_by'])) + { + unset($data['modified_by']); + } + } + + return parent::validate($form, $data, $group); + } + /** * Method to save the form data. * diff --git a/administrator/components/com_content/models/articles.php b/administrator/components/com_content/models/articles.php index dd4606404256a..40cbfc45263a1 100644 --- a/administrator/components/com_content/models/articles.php +++ b/administrator/components/com_content/models/articles.php @@ -40,6 +40,7 @@ public function __construct($config = array()) 'state', 'a.state', 'access', 'a.access', 'access_level', 'created', 'a.created', + 'modified', 'a.modified', 'created_by', 'a.created_by', 'created_by_alias', 'a.created_by_alias', 'ordering', 'a.ordering', @@ -52,7 +53,8 @@ public function __construct($config = array()) 'author_id', 'category_id', 'level', - 'tag' + 'tag', + 'rating_count', 'rating', ); if (JLanguageAssociations::isEnabled()) @@ -174,7 +176,7 @@ protected function getListQuery() $this->getState( 'list.select', 'a.id, a.title, a.alias, a.checked_out, a.checked_out_time, a.catid' . - ', a.state, a.access, a.created, a.created_by, a.created_by_alias, a.ordering, a.featured, a.language, a.hits' . + ', a.state, a.access, a.created, a.created_by, a.created_by_alias, a.modified, a.ordering, a.featured, a.language, a.hits' . ', a.publish_up, a.publish_down' ) ); @@ -322,14 +324,8 @@ protected function getListQuery() } // Add the list ordering clause. - $orderCol = $this->state->get('list.fullordering', 'a.id'); - $orderDirn = ''; - - if (empty($orderCol)) - { - $orderCol = $this->state->get('list.ordering', 'a.id'); - $orderDirn = $this->state->get('list.direction', 'DESC'); - } + $orderCol = $this->state->get('list.ordering', 'a.id'); + $orderDirn = $this->state->get('list.direction', 'DESC'); $query->order($db->escape($orderCol) . ' ' . $db->escape($orderDirn)); diff --git a/administrator/components/com_content/models/featured.php b/administrator/components/com_content/models/featured.php index 1293c1abacc2a..c66dc0921f4f4 100644 --- a/administrator/components/com_content/models/featured.php +++ b/administrator/components/com_content/models/featured.php @@ -55,7 +55,8 @@ public function __construct($config = array()) 'author_id', 'category_id', 'level', - 'tag' + 'tag', + 'rating_count', 'rating', ); } @@ -220,14 +221,8 @@ protected function getListQuery() } // Add the list ordering clause. - $orderCol = $this->state->get('list.fullordering', 'a.title'); - $orderDirn = ''; - - if (empty($orderCol)) - { - $orderCol = $this->state->get('list.ordering', 'a.title'); - $orderDirn = $this->state->get('list.direction', 'ASC'); - } + $orderCol = $this->state->get('list.ordering', 'a.title'); + $orderDirn = $this->state->get('list.direction', 'ASC'); $query->order($db->escape($orderCol) . ' ' . $db->escape($orderDirn)); diff --git a/administrator/components/com_content/models/fields/votelist.php b/administrator/components/com_content/models/fields/votelist.php new file mode 100644 index 0000000000000..c116dbcb8ee28 --- /dev/null +++ b/administrator/components/com_content/models/fields/votelist.php @@ -0,0 +1,43 @@ + diff --git a/administrator/components/com_content/models/forms/filter_articles.xml b/administrator/components/com_content/models/forms/filter_articles.xml index 3ac0fcdbbdcc8..f8c297e4d7127 100644 --- a/administrator/components/com_content/models/forms/filter_articles.xml +++ b/administrator/components/com_content/models/forms/filter_articles.xml @@ -110,6 +110,8 @@ + + diff --git a/administrator/components/com_content/views/article/view.html.php b/administrator/components/com_content/views/article/view.html.php index 4a3154fbb5161..299957ef8902a 100644 --- a/administrator/components/com_content/views/article/view.html.php +++ b/administrator/components/com_content/views/article/view.html.php @@ -69,9 +69,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } // If we are forcing a language in modal (used for associations). diff --git a/administrator/components/com_content/views/articles/tmpl/default.php b/administrator/components/com_content/views/articles/tmpl/default.php index a06d75f48f795..34bdf66d21214 100644 --- a/administrator/components/com_content/views/articles/tmpl/default.php +++ b/administrator/components/com_content/views/articles/tmpl/default.php @@ -18,7 +18,7 @@ $app = JFactory::getApplication(); $user = JFactory::getUser(); $userId = $user->get('id'); -$listOrder = str_replace(' ' . $this->state->get('list.direction'), '', $this->state->get('list.fullordering')); +$listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); $saveOrder = $listOrder == 'a.ordering'; $columns = 10; @@ -31,6 +31,10 @@ { $orderingColumn = 'publish_down'; } +elseif (strpos($listOrder, 'modified') !== false) +{ + $orderingColumn = 'modified'; +} else { $orderingColumn = 'created'; @@ -147,7 +151,7 @@ - + diff --git a/administrator/components/com_content/views/articles/view.html.php b/administrator/components/com_content/views/articles/view.html.php index 76b97bddcdc3c..00a8b867cb439 100644 --- a/administrator/components/com_content/views/articles/view.html.php +++ b/administrator/components/com_content/views/articles/view.html.php @@ -90,9 +90,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } // Levels filter - Used in Hathor. diff --git a/administrator/components/com_content/views/featured/tmpl/default.php b/administrator/components/com_content/views/featured/tmpl/default.php index 4c41a9168e3b5..870f6e9ecf621 100644 --- a/administrator/components/com_content/views/featured/tmpl/default.php +++ b/administrator/components/com_content/views/featured/tmpl/default.php @@ -17,7 +17,7 @@ $user = JFactory::getUser(); $userId = $user->get('id'); -$listOrder = str_replace(' ' . $this->state->get('list.direction'), '', $this->state->get('list.fullordering')); +$listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); $saveOrder = $listOrder == 'fp.ordering'; $columns = 10; @@ -141,7 +141,7 @@ - + diff --git a/administrator/components/com_content/views/featured/view.html.php b/administrator/components/com_content/views/featured/view.html.php index 0fbd1bd3aa920..c24f380e23934 100644 --- a/administrator/components/com_content/views/featured/view.html.php +++ b/administrator/components/com_content/views/featured/view.html.php @@ -87,9 +87,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } // Levels filter - Used in Hathor. diff --git a/administrator/components/com_contenthistory/helpers/contenthistory.php b/administrator/components/com_contenthistory/helpers/contenthistory.php index 5b4d971fdb0f3..2b5801ea75710 100644 --- a/administrator/components/com_contenthistory/helpers/contenthistory.php +++ b/administrator/components/com_contenthistory/helpers/contenthistory.php @@ -29,6 +29,11 @@ public static function createObjectArray($object) { $result = array(); + if ($object === null) + { + return $result; + } + foreach ($object as $name => $value) { $result[$name] = $value; @@ -289,6 +294,11 @@ public static function mergeLabels($object, $formValues) { $result = new stdClass; + if ($object === null) + { + return $result; + } + $labelsArray = $formValues->labels; $valuesArray = $formValues->values; diff --git a/administrator/components/com_contenthistory/views/compare/view.html.php b/administrator/components/com_contenthistory/views/compare/view.html.php index 701242388f6a0..d02063defff09 100644 --- a/administrator/components/com_contenthistory/views/compare/view.html.php +++ b/administrator/components/com_contenthistory/views/compare/view.html.php @@ -37,9 +37,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } return parent::display($tpl); diff --git a/administrator/components/com_contenthistory/views/history/tmpl/modal.php b/administrator/components/com_contenthistory/views/history/tmpl/modal.php index 70da60d755d3a..ce6de9d985568 100644 --- a/administrator/components/com_contenthistory/views/history/tmpl/modal.php +++ b/administrator/components/com_contenthistory/views/history/tmpl/modal.php @@ -91,15 +91,15 @@
- - - - -
diff --git a/administrator/components/com_contenthistory/views/history/view.html.php b/administrator/components/com_contenthistory/views/history/view.html.php index a3596af43d3d3..c26fcdc291b72 100644 --- a/administrator/components/com_contenthistory/views/history/view.html.php +++ b/administrator/components/com_contenthistory/views/history/view.html.php @@ -40,9 +40,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } return parent::display($tpl); diff --git a/administrator/components/com_contenthistory/views/preview/view.html.php b/administrator/components/com_contenthistory/views/preview/view.html.php index 726cbd4c9b87a..84d1932eb2de7 100644 --- a/administrator/components/com_contenthistory/views/preview/view.html.php +++ b/administrator/components/com_contenthistory/views/preview/view.html.php @@ -46,9 +46,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } return parent::display($tpl); diff --git a/administrator/components/com_fields/controllers/field.php b/administrator/components/com_fields/controllers/field.php index 83b0dbb8979ae..d2205e87d837a 100644 --- a/administrator/components/com_fields/controllers/field.php +++ b/administrator/components/com_fields/controllers/field.php @@ -72,7 +72,15 @@ public function storeform() $app->setUserState($this->input->get('userstatevariable'), $data); } - $app->redirect(base64_decode($this->input->get->getBase64('return'))); + $redirectUrl = base64_decode($this->input->get->getBase64('return')); + + // Don't redirect to an external URL. + If (!JUri::isInternal($redirectUrl)) + { + $redirectUrl = 'index.php'; + } + + $app->redirect($redirectUrl); $app->close(); } diff --git a/administrator/components/com_fields/fields.php b/administrator/components/com_fields/fields.php index ef0dbf01d9c9a..0b806a0d3d4ca 100644 --- a/administrator/components/com_fields/fields.php +++ b/administrator/components/com_fields/fields.php @@ -22,7 +22,7 @@ if (!$parts || !JFactory::getUser()->authorise('core.manage', $parts[0])) { - return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR')); + throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403); } $controller = JControllerLegacy::getInstance('Fields'); diff --git a/administrator/components/com_fields/helpers/fields.php b/administrator/components/com_fields/helpers/fields.php index 06430703f5763..aedb4666112b0 100644 --- a/administrator/components/com_fields/helpers/fields.php +++ b/administrator/components/com_fields/helpers/fields.php @@ -243,7 +243,7 @@ public static function render($context, $layoutFile, $displayData) */ if ($parts = self::extract($context)) { - // Trying to render the layout on the component fom the context + // Trying to render the layout on the component from the context $value = JLayoutHelper::render($layoutFile, $displayData, null, array('component' => $parts[0], 'client' => 0)); } @@ -403,7 +403,7 @@ function categoryHasChanged(element) { // On the front, sometimes the admin fields path is not included JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_fields/tables'); - // Looping trough the groups + // Looping through the groups foreach ($fieldsPerGroup as $group_id => $groupFields) { if (!$groupFields) @@ -463,7 +463,7 @@ function categoryHasChanged(element) { $fieldset->setAttribute('label', $label); $fieldset->setAttribute('description', strip_tags($description)); - // Looping trough the fields for that context + // Looping through the fields for that context foreach ($groupFields as $field) { try @@ -485,7 +485,7 @@ function categoryHasChanged(element) { } } - // When he field set is empty, then remove it + // When the field set is empty, then remove it if (!$fieldset->hasChildNodes()) { $fieldsNode->removeChild($fieldset); @@ -504,7 +504,7 @@ function categoryHasChanged(element) { $data->id = JFactory::getApplication()->input->getInt('id'); } - // Looping trough the fields again to set the value + // Looping through the fields again to set the value if (!isset($data->id) || !$data->id) { return true; diff --git a/administrator/components/com_fields/libraries/fieldslistplugin.php b/administrator/components/com_fields/libraries/fieldslistplugin.php index 92f9cb83dc54e..2074010440035 100644 --- a/administrator/components/com_fields/libraries/fieldslistplugin.php +++ b/administrator/components/com_fields/libraries/fieldslistplugin.php @@ -41,8 +41,8 @@ public function onCustomFieldsPrepareDom($field, DOMElement $parent, JForm $form foreach ($this->getOptionsFromField($field) as $value => $name) { - $option = new DOMElement('option', htmlentities($value)); - $option->nodeValue = htmlentities(JText::_($name)); + $option = new DOMElement('option', htmlspecialchars($value, ENT_COMPAT, 'UTF-8')); + $option->nodeValue = htmlspecialchars(JText::_($name), ENT_COMPAT, 'UTF-8'); $element = $fieldNode->appendChild($option); $element->setAttribute('value', $value); diff --git a/administrator/components/com_fields/libraries/fieldsplugin.php b/administrator/components/com_fields/libraries/fieldsplugin.php index f5d9c1973079b..84eca9a148988 100644 --- a/administrator/components/com_fields/libraries/fieldsplugin.php +++ b/administrator/components/com_fields/libraries/fieldsplugin.php @@ -166,13 +166,6 @@ public function onCustomFieldsPrepareDom($field, DOMElement $parent, JForm $form $node->setAttribute('class', $field->params->get('class')); $node->setAttribute('hint', $field->params->get('hint')); $node->setAttribute('required', $field->required ? 'true' : 'false'); - $node->setAttribute('readonly', $field->params->get('readonly', 0) ? 'true' : 'false'); - - // Set the disabled state based on the parameter and the permission - if ($field->params->get('disabled', 0)) - { - $node->setAttribute('disabled', 'true'); - } // Combine the two params $params = clone $this->params; diff --git a/administrator/components/com_fields/models/field.php b/administrator/components/com_fields/models/field.php index 6dcb19fc63622..45debf58b2216 100644 --- a/administrator/components/com_fields/models/field.php +++ b/administrator/components/com_fields/models/field.php @@ -565,9 +565,8 @@ public function setFieldValue($fieldId, $itemId, $value) $params = new Registry($params); } - // Don't save the value when the field is disabled or the user is - // not authorized to change it - if (!$field || $params->get('disabled', 0) || !FieldsHelper::canEditFieldValue($field)) + // Don't save the value when the user is not authorized to change it + if (!$field || !FieldsHelper::canEditFieldValue($field)) { return false; } @@ -921,6 +920,7 @@ protected function loadFormData() protected function preprocessForm(JForm $form, $data, $group = 'content') { $component = $this->state->get('field.component'); + $section = $this->state->get('field.section'); $dataObject = $data; if (is_array($dataObject)) @@ -968,6 +968,21 @@ protected function preprocessForm(JForm $form, $data, $group = 'content') $form->setFieldAttribute('group_id', 'context', $this->state->get('field.context')); $form->setFieldAttribute('rules', 'component', $component); + // Looking first in the component models/forms folder + $path = JPath::clean(JPATH_ADMINISTRATOR . '/components/' . $component . '/models/forms/fields/' . $section . '.xml'); + + if (file_exists($path)) + { + $lang = JFactory::getLanguage(); + $lang->load($component, JPATH_BASE, null, false, true); + $lang->load($component, JPATH_BASE . '/components/' . $component, null, false, true); + + if (!$form->loadFile($path, false)) + { + throw new Exception(JText::_('JERROR_LOADFILE_FAILED')); + } + } + // Trigger the default form events. parent::preprocessForm($form, $data, $group); } diff --git a/administrator/components/com_fields/models/fields.php b/administrator/components/com_fields/models/fields.php index 91f043aef0a7f..56620b66212b8 100644 --- a/administrator/components/com_fields/models/fields.php +++ b/administrator/components/com_fields/models/fields.php @@ -228,7 +228,7 @@ protected function getListQuery() } // Implement View Level Access - if (!$user->authorise('core.admin')) + if (!$app->isClient('administrator') || !$user->authorise('core.admin')) { $groups = implode(',', $user->getAuthorisedViewLevels()); $query->where('a.access IN (' . $groups . ') AND (a.group_id = 0 OR g.access IN (' . $groups . '))'); @@ -302,15 +302,9 @@ protected function getListQuery() } // Add the list ordering clause - $listOrdering = $this->getState('list.fullordering', 'a.ordering'); - $orderDirn = ''; + $listOrdering = $this->state->get('list.ordering', 'a.ordering'); + $orderDirn = $this->state->get('list.direction', 'ASC'); - if (empty($listOrdering)) - { - $listOrdering = $this->state->get('list.ordering', 'a.ordering'); - $orderDirn = $this->state->get('list.direction', 'DESC'); - } - $query->order($db->escape($listOrdering) . ' ' . $db->escape($orderDirn)); return $query; @@ -350,7 +344,7 @@ protected function _getList($query, $limitstart = 0, $limit = 0) * @param array $data data * @param boolean $loadData load current data * - * @return JForm/false the JForm object or false + * @return JForm|false the JForm object or false * * @since 3.7.0 */ diff --git a/administrator/components/com_fields/models/fields/section.php b/administrator/components/com_fields/models/fields/section.php index 4d74202c1d61b..9532ac633c485 100644 --- a/administrator/components/com_fields/models/fields/section.php +++ b/administrator/components/com_fields/models/fields/section.php @@ -24,7 +24,7 @@ class JFormFieldSection extends JFormFieldList * * @param SimpleXMLElement $element The SimpleXMLElement object representing the `` tag for the form field object. * @param mixed $value The form field value to validate. - * @param string $group The field name group control value. This acts as as an array container for the field. + * @param string $group The field name group control value. This acts as an array container for the field. * For example if the field has name="foo" and the group value is set to "bar" then the * full field name would end up being "bar[foo]". * diff --git a/administrator/components/com_fields/models/fields/type.php b/administrator/components/com_fields/models/fields/type.php index 054fb68b9b9f0..aa24240595cdb 100644 --- a/administrator/components/com_fields/models/fields/type.php +++ b/administrator/components/com_fields/models/fields/type.php @@ -24,7 +24,7 @@ class JFormFieldType extends JFormFieldList * * @param SimpleXMLElement $element The SimpleXMLElement object representing the `` tag for the form field object. * @param mixed $value The form field value to validate. - * @param string $group The field name group control value. This acts as as an array container for the field. + * @param string $group The field name group control value. This acts as an array container for the field. * For example if the field has name="foo" and the group value is set to "bar" then the * full field name would end up being "bar[foo]". * diff --git a/administrator/components/com_fields/models/forms/field.xml b/administrator/components/com_fields/models/forms/field.xml index 69398da5f8f29..c4ba27f22d8ee 100644 --- a/administrator/components/com_fields/models/forms/field.xml +++ b/administrator/components/com_fields/models/forms/field.xml @@ -261,30 +261,6 @@ - - - - - - - - - - name = $this->title; } - $this->name = JApplicationHelper::stringURLSafe($this->name); + $this->name = JApplicationHelper::stringURLSafe($this->name, $this->language); if (trim(str_replace('-', '', $this->name)) == '') { @@ -177,7 +177,7 @@ protected function _getAssetName() * * @return string The string to use as the title in the asset table. * - * @link https://docs.joomla.org/JTable/getAssetTitle + * @link https://docs.joomla.org/Special:MyLanguage/JTable/getAssetTitle * @since 3.7.0 */ protected function _getAssetTitle() diff --git a/administrator/components/com_fields/tables/group.php b/administrator/components/com_fields/tables/group.php index ec160ddc46336..200231e56a3da 100644 --- a/administrator/components/com_fields/tables/group.php +++ b/administrator/components/com_fields/tables/group.php @@ -71,7 +71,7 @@ public function bind($src, $ignore = '') * * @return boolean True if the instance is sane and able to be stored in the database. * - * @link https://docs.joomla.org/JTable/check + * @link https://docs.joomla.org/Special:MyLanguage/JTable/check * @since 3.7.0 */ public function check() @@ -133,7 +133,7 @@ protected function _getAssetName() * * @return string The string to use as the title in the asset table. * - * @link https://docs.joomla.org/JTable/getAssetTitle + * @link https://docs.joomla.org/Special:MyLanguage/JTable/getAssetTitle * @since 3.7.0 */ protected function _getAssetTitle() diff --git a/administrator/components/com_fields/views/field/view.html.php b/administrator/components/com_fields/views/field/view.html.php index 32f5c449f7cb8..8c7940a725a80 100644 --- a/administrator/components/com_fields/views/field/view.html.php +++ b/administrator/components/com_fields/views/field/view.html.php @@ -57,9 +57,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } JFactory::getApplication()->input->set('hidemainmenu', true); diff --git a/administrator/components/com_fields/views/fields/tmpl/default.php b/administrator/components/com_fields/views/fields/tmpl/default.php index e05c47f302200..cb96ce15463ad 100644 --- a/administrator/components/com_fields/views/fields/tmpl/default.php +++ b/administrator/components/com_fields/views/fields/tmpl/default.php @@ -20,7 +20,7 @@ $userId = $user->get('id'); $context = $this->escape($this->state->get('filter.context')); $component = $this->state->get('filter.component'); -$listOrder = str_replace(' ' . $this->state->get('list.direction'), '', $this->state->get('list.fullordering')); +$listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); $ordering = ($listOrder == 'a.ordering'); $saveOrder = ($listOrder == 'a.ordering' && strtolower($listDirn) == 'asc'); diff --git a/administrator/components/com_fields/views/fields/tmpl/modal.php b/administrator/components/com_fields/views/fields/tmpl/modal.php index d4ddd216f03c4..50bc7b1875da5 100644 --- a/administrator/components/com_fields/views/fields/tmpl/modal.php +++ b/administrator/components/com_fields/views/fields/tmpl/modal.php @@ -17,6 +17,7 @@ JHtml::_('behavior.core'); JHtml::_('bootstrap.tooltip', '.hasTooltip', array('placement' => 'bottom')); JHtml::_('formbehavior.chosen', 'select'); +JHtml::_('script', 'com_fields/admin-fields-modal.js', array('version' => 'auto', 'relative' => true)); // Special case for the search field tooltip. $searchFilterDesc = $this->filterForm->getFieldAttribute('search', 'description', null, 'filter'); @@ -25,16 +26,6 @@ $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); $editor = JFactory::getApplication()->input->get('editor', '', 'cmd'); - -JFactory::getDocument()->addScriptDeclaration(' -fieldIns = function(id) { - window.parent.jInsertEditorText("{field " + id + "}", "' . $editor . '"); - window.parent.jModalClose(); -}; -fieldgroupIns = function(id) { - window.parent.jInsertEditorText("{fieldgroup " + id + "}", "' . $editor . '"); - window.parent.jModalClose(); -};'); ?>
@@ -94,10 +85,10 @@ - escape($item->title); ?> + escape($item->title); ?> - group_id ? $this->escape($item->group_title) : JText::_('JNONE'); ?> + group_id ? $this->escape($item->group_title) : JText::_('JNONE'); ?> type; ?> diff --git a/administrator/components/com_fields/views/fields/view.html.php b/administrator/components/com_fields/views/fields/view.html.php index a6cefc6fe9e25..da6aa7f407f92 100644 --- a/administrator/components/com_fields/views/fields/view.html.php +++ b/administrator/components/com_fields/views/fields/view.html.php @@ -78,9 +78,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } // Display a warning if the fields system plugin is disabled diff --git a/administrator/components/com_fields/views/group/view.html.php b/administrator/components/com_fields/views/group/view.html.php index 9b89f2527e17a..0b5789c33aace 100644 --- a/administrator/components/com_fields/views/group/view.html.php +++ b/administrator/components/com_fields/views/group/view.html.php @@ -75,9 +75,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } JFactory::getApplication()->input->set('hidemainmenu', true); diff --git a/administrator/components/com_fields/views/groups/view.html.php b/administrator/components/com_fields/views/groups/view.html.php index f0bdcec38b51f..3450e1acec288 100644 --- a/administrator/components/com_fields/views/groups/view.html.php +++ b/administrator/components/com_fields/views/groups/view.html.php @@ -78,9 +78,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } // Display a warning if the fields system plugin is disabled diff --git a/administrator/components/com_finder/views/filter/tmpl/edit.php b/administrator/components/com_finder/views/filter/tmpl/edit.php index 166f8cdf7627e..ddbad1e111e0b 100644 --- a/administrator/components/com_finder/views/filter/tmpl/edit.php +++ b/administrator/components/com_finder/views/filter/tmpl/edit.php @@ -12,6 +12,7 @@ JHtml::_('behavior.formvalidator'); JHtml::_('behavior.keepalive'); JHtml::_('formbehavior.chosen', 'select'); +JHtml::_('behavior.tabstate'); JFactory::getDocument()->addScriptDeclaration(' Joomla.submitbutton = function(task) @@ -70,10 +71,10 @@
form->renderField('map_count'); ?>
- - +
diff --git a/administrator/components/com_finder/views/filter/view.html.php b/administrator/components/com_finder/views/filter/view.html.php index fa7140476bb02..e107675311a5f 100644 --- a/administrator/components/com_finder/views/filter/view.html.php +++ b/administrator/components/com_finder/views/filter/view.html.php @@ -65,9 +65,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html'); diff --git a/administrator/components/com_finder/views/filters/view.html.php b/administrator/components/com_finder/views/filters/view.html.php index e557b22c746c0..d72f70ea9d87e 100644 --- a/administrator/components/com_finder/views/filters/view.html.php +++ b/administrator/components/com_finder/views/filters/view.html.php @@ -75,9 +75,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html'); diff --git a/administrator/components/com_finder/views/maps/view.html.php b/administrator/components/com_finder/views/maps/view.html.php index e0f3287594f33..cbb40d53377f0 100644 --- a/administrator/components/com_finder/views/maps/view.html.php +++ b/administrator/components/com_finder/views/maps/view.html.php @@ -80,9 +80,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html'); diff --git a/administrator/components/com_finder/views/statistics/view.html.php b/administrator/components/com_finder/views/statistics/view.html.php index bb7ad0c0b8e93..4a9dfa0435dba 100644 --- a/administrator/components/com_finder/views/statistics/view.html.php +++ b/administrator/components/com_finder/views/statistics/view.html.php @@ -40,9 +40,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } return parent::display($tpl); diff --git a/administrator/components/com_installer/controllers/install.php b/administrator/components/com_installer/controllers/install.php index 9334a83800781..8289990361a2e 100644 --- a/administrator/components/com_installer/controllers/install.php +++ b/administrator/components/com_installer/controllers/install.php @@ -28,15 +28,11 @@ public function install() // Check for request forgeries. JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + /** @var InstallerModelInstall $model */ $model = $this->getModel('install'); - if ($result = $model->install()) - { - $cache = JFactory::getCache('mod_menu'); - $cache->clean(); - - // TODO: Reset the users acl here as well to kill off any missing bits. - } + // TODO: Reset the users acl here as well to kill off any missing bits. + $result = $model->install(); $app = JFactory::getApplication(); $redirect_url = $app->getUserState('com_installer.redirect_url'); diff --git a/administrator/components/com_installer/controllers/manage.php b/administrator/components/com_installer/controllers/manage.php index af9df3f34e942..e4f01a2ca237e 100644 --- a/administrator/components/com_installer/controllers/manage.php +++ b/administrator/components/com_installer/controllers/manage.php @@ -58,6 +58,7 @@ public function publish() else { // Get the model. + /** @var InstallerModelManage $model */ $model = $this->getModel('manage'); // Change the state of the records. @@ -95,7 +96,9 @@ public function remove() // Check for request forgeries. JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); - $eid = $this->input->get('cid', array(), 'array'); + $eid = $this->input->get('cid', array(), 'array'); + + /** @var InstallerModelManage $model */ $model = $this->getModel('manage'); $eid = ArrayHelper::toInteger($eid, array()); diff --git a/administrator/components/com_installer/controllers/update.php b/administrator/components/com_installer/controllers/update.php index a3b541c07a6ef..c691e5c144de1 100644 --- a/administrator/components/com_installer/controllers/update.php +++ b/administrator/components/com_installer/controllers/update.php @@ -43,11 +43,6 @@ public function update() $model->update($uid, $minimum_stability); - if ($model->getState('result', false)) - { - JFactory::getCache('mod_menu')->clean(); - } - $app = JFactory::getApplication(); $redirect_url = $app->getUserState('com_installer.redirect_url'); diff --git a/administrator/components/com_installer/models/database.php b/administrator/components/com_installer/models/database.php index 6d24747c3f6e6..bd6a3e013498f 100644 --- a/administrator/components/com_installer/models/database.php +++ b/administrator/components/com_installer/models/database.php @@ -15,7 +15,7 @@ JLoader::register('JoomlaInstallerScript', JPATH_ADMINISTRATOR . '/components/com_admin/script.php'); /** - * Installer Manage Model + * Installer Database Model * * @since 1.6 */ diff --git a/administrator/components/com_installer/models/forms/filter_updatesites.xml b/administrator/components/com_installer/models/forms/filter_updatesites.xml index 73d0a70585870..ec17aeec0647d 100644 --- a/administrator/components/com_installer/models/forms/filter_updatesites.xml +++ b/administrator/components/com_installer/models/forms/filter_updatesites.xml @@ -18,8 +18,8 @@ onchange="this.form.submit();" > - - + + cleanCache('_system', 0); + $this->cleanCache('_system', 1); + $this->cleanCache('com_modules', 0); + $this->cleanCache('com_modules', 1); + $this->cleanCache('com_plugins', 0); + $this->cleanCache('com_plugins', 1); + $this->cleanCache('mod_menu', 0); + $this->cleanCache('mod_menu', 1); + return $result; } diff --git a/administrator/components/com_installer/models/manage.php b/administrator/components/com_installer/models/manage.php index 18ccb15b9e987..f6f6f492ecd3a 100644 --- a/administrator/components/com_installer/models/manage.php +++ b/administrator/components/com_installer/models/manage.php @@ -146,6 +146,14 @@ public function publish(&$eid = array(), $value = 1) } } + // Clear the cached extension data and menu cache + $this->cleanCache('_system', 0); + $this->cleanCache('_system', 1); + $this->cleanCache('com_modules', 0); + $this->cleanCache('com_modules', 1); + $this->cleanCache('mod_menu', 0); + $this->cleanCache('mod_menu', 1); + return $result; } @@ -261,6 +269,16 @@ public function remove($eid = array()) $app->setUserState('com_installer.message', $installer->message); $app->setUserState('com_installer.extension_message', $installer->get('extension_message')); + // Clear the cached extension data and menu cache + $this->cleanCache('_system', 0); + $this->cleanCache('_system', 1); + $this->cleanCache('com_modules', 0); + $this->cleanCache('com_modules', 1); + $this->cleanCache('com_plugins', 0); + $this->cleanCache('com_plugins', 1); + $this->cleanCache('mod_menu', 0); + $this->cleanCache('mod_menu', 1); + return $result; } diff --git a/administrator/components/com_installer/models/update.php b/administrator/components/com_installer/models/update.php index 368b48101cb37..15e5113b61126 100644 --- a/administrator/components/com_installer/models/update.php +++ b/administrator/components/com_installer/models/update.php @@ -371,6 +371,16 @@ public function update($uids, $minimum_stability = JUpdater::STABILITY_STABLE) $result = $res & $result; } + // Clear the cached extension data and menu cache + $this->cleanCache('_system', 0); + $this->cleanCache('_system', 1); + $this->cleanCache('com_modules', 0); + $this->cleanCache('com_modules', 1); + $this->cleanCache('com_plugins', 0); + $this->cleanCache('com_plugins', 1); + $this->cleanCache('mod_menu', 0); + $this->cleanCache('mod_menu', 1); + // Set the final state $this->setState('result', $result); } @@ -525,7 +535,7 @@ protected function loadFormData() protected function preparePreUpdate($update, $table) { jimport('joomla.filesystem.file'); - + switch ($table->type) { // Components could have a helper which adds additional data @@ -535,11 +545,11 @@ protected function preparePreUpdate($update, $table) $cname = ucfirst($ename) . 'Helper'; $path = JPATH_ADMINISTRATOR . '/components/' . $table->element . '/helpers/' . $fname; - + if (JFile::exists($path)) { require_once $path; - + if (class_exists($cname) && is_callable(array($cname, 'prepareUpdate'))) { call_user_func_array(array($cname, 'prepareUpdate'), array(&$update, &$table)); @@ -552,19 +562,19 @@ protected function preparePreUpdate($update, $table) case 'module': $cname = str_replace('_', '', $table->element) . 'Helper'; $path = ($table->client_id ? JPATH_ADMINISTRATOR : JPATH_SITE) . '/modules/' . $table->element . '/helper.php'; - + if (JFile::exists($path)) { require_once $path; - + if (class_exists($cname) && is_callable(array($cname, 'prepareUpdate'))) { call_user_func_array(array($cname, 'prepareUpdate'), array(&$update, &$table)); } } - + break; - + // If we have a plugin, we can use the plugin trigger "onInstallerBeforePackageDownload" // But we should make sure, that our plugin is loaded, so we don't need a second "installer" plugin case 'plugin': diff --git a/administrator/components/com_installer/models/warnings.php b/administrator/components/com_installer/models/warnings.php index e62aea647785d..d3427ae6ceb7a 100644 --- a/administrator/components/com_installer/models/warnings.php +++ b/administrator/components/com_installer/models/warnings.php @@ -10,7 +10,7 @@ defined('_JEXEC') or die; /** - * Extension Manager Templates Model + * Installer Warnings Model * * @since 1.6 */ diff --git a/administrator/components/com_installer/views/database/view.html.php b/administrator/components/com_installer/views/database/view.html.php index d1cf21f5ea9c7..d51d79eb0a660 100644 --- a/administrator/components/com_installer/views/database/view.html.php +++ b/administrator/components/com_installer/views/database/view.html.php @@ -12,7 +12,7 @@ JLoader::register('InstallerViewDefault', dirname(__DIR__) . '/default/view.php'); /** - * Extension Manager Manage View + * Extension Manager Database View * * @since 1.6 */ diff --git a/administrator/components/com_installer/views/discover/tmpl/default.php b/administrator/components/com_installer/views/discover/tmpl/default.php index 5d184b9e5bb30..d2918e86ce134 100644 --- a/administrator/components/com_installer/views/discover/tmpl/default.php +++ b/administrator/components/com_installer/views/discover/tmpl/default.php @@ -34,11 +34,15 @@ $this)); ?>
+
+ +
items)) : ?>
+ @@ -115,7 +119,6 @@
-
diff --git a/administrator/components/com_installer/views/languages/tmpl/default.php b/administrator/components/com_installer/views/languages/tmpl/default.php index 6eb4e5bb65336..4a92616ee53a2 100644 --- a/administrator/components/com_installer/views/languages/tmpl/default.php +++ b/administrator/components/com_installer/views/languages/tmpl/default.php @@ -74,9 +74,7 @@ - + name; ?> code; ?> diff --git a/administrator/components/com_installer/views/languages/view.html.php b/administrator/components/com_installer/views/languages/view.html.php index 7c41f9cee388a..36ab4bb8e9e0a 100644 --- a/administrator/components/com_installer/views/languages/view.html.php +++ b/administrator/components/com_installer/views/languages/view.html.php @@ -12,7 +12,7 @@ JLoader::register('InstallerViewDefault', dirname(__DIR__) . '/default/view.php'); /** - * Language installer view + * Extension Manager Language Install View * * @since 2.5.7 */ @@ -53,9 +53,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } parent::display($tpl); diff --git a/administrator/components/com_installer/views/manage/view.html.php b/administrator/components/com_installer/views/manage/view.html.php index 4f1b6d4aae3f7..b8891f18d7c32 100644 --- a/administrator/components/com_installer/views/manage/view.html.php +++ b/administrator/components/com_installer/views/manage/view.html.php @@ -47,9 +47,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } // Include the component HTML helpers. diff --git a/administrator/components/com_installer/views/warnings/view.html.php b/administrator/components/com_installer/views/warnings/view.html.php index 0a9078f99c34f..1b9a8dcc8ed52 100644 --- a/administrator/components/com_installer/views/warnings/view.html.php +++ b/administrator/components/com_installer/views/warnings/view.html.php @@ -12,7 +12,7 @@ JLoader::register('InstallerViewDefault', dirname(__DIR__) . '/default/view.php'); /** - * Extension Manager Templates View + * Extension Manager Warning View * * @since 1.6 */ diff --git a/administrator/components/com_joomlaupdate/models/default.php b/administrator/components/com_joomlaupdate/models/default.php index 3af6fcd0ea384..ba19761a61b1c 100644 --- a/administrator/components/com_joomlaupdate/models/default.php +++ b/administrator/components/com_joomlaupdate/models/default.php @@ -924,7 +924,7 @@ public function captiveLogin($credentials) $username = isset($credentials['username']) ? $credentials['username'] : null; $user = JFactory::getUser(); - if ($user->username != $username) + if (strtolower($user->username) != strtolower($username)) { return false; } diff --git a/administrator/components/com_joomlaupdate/views/default/tmpl/default_upload.php b/administrator/components/com_joomlaupdate/views/default/tmpl/default_upload.php index 8e12a89bb3828..e46fb4eb56917 100644 --- a/administrator/components/com_joomlaupdate/views/default/tmpl/default_upload.php +++ b/administrator/components/com_joomlaupdate/views/default/tmpl/default_upload.php @@ -61,7 +61,7 @@

- +

diff --git a/administrator/components/com_joomlaupdate/views/update/tmpl/finaliseconfirm.php b/administrator/components/com_joomlaupdate/views/update/tmpl/finaliseconfirm.php index 3131121d07d19..1aefb29f08ce8 100644 --- a/administrator/components/com_joomlaupdate/views/update/tmpl/finaliseconfirm.php +++ b/administrator/components/com_joomlaupdate/views/update/tmpl/finaliseconfirm.php @@ -33,7 +33,7 @@
- + @@ -46,7 +46,7 @@
- + @@ -60,14 +60,14 @@
- + - +
@@ -77,12 +77,12 @@
diff --git a/administrator/components/com_joomlaupdate/views/upload/tmpl/captive.php b/administrator/components/com_joomlaupdate/views/upload/tmpl/captive.php index 0f293137091e8..5e39bf2b18188 100644 --- a/administrator/components/com_joomlaupdate/views/upload/tmpl/captive.php +++ b/administrator/components/com_joomlaupdate/views/upload/tmpl/captive.php @@ -32,7 +32,7 @@
- + @@ -45,7 +45,7 @@
- + @@ -59,14 +59,14 @@
- + - +
@@ -76,12 +76,12 @@
diff --git a/administrator/components/com_languages/helpers/multilangstatus.php b/administrator/components/com_languages/helpers/multilangstatus.php index 7f81901b625fe..c4c3c798a7e25 100644 --- a/administrator/components/com_languages/helpers/multilangstatus.php +++ b/administrator/components/com_languages/helpers/multilangstatus.php @@ -40,7 +40,7 @@ public static function getHomes() /** * Method to get the number of published language switcher modules. * - * @return integer. + * @return integer */ public static function getLangswitchers() { diff --git a/administrator/components/com_languages/views/installed/view.html.php b/administrator/components/com_languages/views/installed/view.html.php index 282bc9449612d..725eebe0eccd8 100644 --- a/administrator/components/com_languages/views/installed/view.html.php +++ b/administrator/components/com_languages/views/installed/view.html.php @@ -70,9 +70,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } $this->addToolbar(); diff --git a/administrator/components/com_languages/views/language/view.html.php b/administrator/components/com_languages/views/language/view.html.php index 93ca48e1fe771..6dca29fbdabfb 100644 --- a/administrator/components/com_languages/views/language/view.html.php +++ b/administrator/components/com_languages/views/language/view.html.php @@ -39,9 +39,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } $this->addToolbar(); diff --git a/administrator/components/com_languages/views/languages/view.html.php b/administrator/components/com_languages/views/languages/view.html.php index 6c771d2a38f82..ac309b5c439ea 100644 --- a/administrator/components/com_languages/views/languages/view.html.php +++ b/administrator/components/com_languages/views/languages/view.html.php @@ -42,9 +42,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } $this->addToolbar(); diff --git a/administrator/components/com_languages/views/overrides/tmpl/default.php b/administrator/components/com_languages/views/overrides/tmpl/default.php index f7cf21f49267d..5de95f42ae144 100644 --- a/administrator/components/com_languages/views/overrides/tmpl/default.php +++ b/administrator/components/com_languages/views/overrides/tmpl/default.php @@ -38,8 +38,8 @@
- - + +
diff --git a/administrator/components/com_login/views/login/view.html.php b/administrator/components/com_login/views/login/view.html.php index 0f9d047e4bf87..0297dc3f4fff8 100644 --- a/administrator/components/com_login/views/login/view.html.php +++ b/administrator/components/com_login/views/login/view.html.php @@ -31,8 +31,8 @@ public function display($tpl = null) * To prevent clickjacking, only allow the login form to be used inside a frame in the same origin. * So send a X-Frame-Options HTTP Header with the SAMEORIGIN value. * - * @see https://www.owasp.org/index.php/Clickjacking_Defense_Cheat_Sheet - * https://tools.ietf.org/html/rfc7034 + * @link https://www.owasp.org/index.php/Clickjacking_Defense_Cheat_Sheet + * @link https://tools.ietf.org/html/rfc7034 */ JFactory::getApplication()->setHeader('X-Frame-Options', 'SAMEORIGIN'); diff --git a/administrator/components/com_media/config.xml b/administrator/components/com_media/config.xml index ffe071a62f513..f3ca4c4eec3a0 100644 --- a/administrator/components/com_media/config.xml +++ b/administrator/components/com_media/config.xml @@ -7,7 +7,7 @@ name="upload_extensions" type="text" size="50" - default="bmp,csv,doc,gif,ico,jpg,jpeg,odg,odp,ods,odt,pdf,png,ppt,swf,txt,xcf,xls,BMP,CSV,DOC,GIF,ICO,JPG,JPEG,ODG,ODP,ODS,ODT,PDF,PNG,PPT,SWF,TXT,XCF,XLS" + default="bmp,csv,doc,gif,ico,jpg,jpeg,odg,odp,ods,odt,pdf,png,ppt,txt,xcf,xls,BMP,CSV,DOC,GIF,ICO,JPG,JPEG,ODG,ODP,ODS,ODT,PDF,PNG,PPT,TXT,XCF,XLS" label="COM_MEDIA_FIELD_LEGAL_EXTENSIONS_LABEL" description="COM_MEDIA_FIELD_LEGAL_EXTENSIONS_DESC" /> @@ -80,7 +80,7 @@ name="upload_mime" type="text" size="50" - default="image/jpeg,image/gif,image/png,image/bmp,application/x-shockwave-flash,application/msword,application/excel,application/pdf,application/powerpoint,text/plain,application/x-zip" + default="image/jpeg,image/gif,image/png,image/bmp,application/msword,application/excel,application/pdf,application/powerpoint,text/plain,application/x-zip" label="COM_MEDIA_FIELD_LEGAL_MIME_TYPES_LABEL" description="COM_MEDIA_FIELD_LEGAL_MIME_TYPES_DESC" /> diff --git a/administrator/components/com_media/controllers/file.php b/administrator/components/com_media/controllers/file.php index d942a1d424b99..7d5ee2952afd1 100644 --- a/administrator/components/com_media/controllers/file.php +++ b/administrator/components/com_media/controllers/file.php @@ -40,7 +40,7 @@ public function upload() $params = JComponentHelper::getParams('com_media'); // Get some data from the request - $files = $this->input->files->get('Filedata', '', 'array'); + $files = $this->input->files->get('Filedata', array(), 'array'); $return = JFactory::getSession()->get('com_media.return_url'); $this->folder = $this->input->get('folder', '', 'path'); @@ -66,6 +66,12 @@ public function upload() return false; } + // If there are no files to upload - then bail + if (empty($files)) + { + return false; + } + // Total length of post back data in bytes. $contentLength = (int) $_SERVER['CONTENT_LENGTH']; diff --git a/administrator/components/com_media/views/media/tmpl/default.php b/administrator/components/com_media/views/media/tmpl/default.php index 406acdb925073..0b24092b5e2c7 100644 --- a/administrator/components/com_media/views/media/tmpl/default.php +++ b/administrator/components/com_media/views/media/tmpl/default.php @@ -47,7 +47,7 @@
sidebar; ?>
-

+