diff --git a/.appveyor.yml b/.appveyor.yml index d7f9429a294c5..7e5f1c09bcf00 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -9,15 +9,30 @@ branches: ## Build matrix for lowest and highest possible targets environment: + DLLVersion: "5.6.1" + PHPBuild: "x64" + VC: "vc15" matrix: - php_ver_target: 5.6 + PHPBuild: "x86" + VC: "vc11" + WINCACHE: "1.3.7.12" - php_ver_target: 7.0 + DLLVersion: "5.3.0" + VC: "vc14" + WINCACHE: "2.0.0.8" - php_ver_target: 7.1 + DLLVersion: "5.3.0" + VC: "vc14" + WINCACHE: "2.0.0.8" + - php_ver_target: 7.2 + DLLVersion: "5.3.0" + - php_ver_target: 7.3 init: - SET PATH=C:\Program Files\OpenSSL;C:\tools\php;%PATH% - SET COMPOSER_NO_INTERACTION=1 - - SET PHP=1 # This var relates to caching the php install + - SET PHP=1 # This var relates to caching the php install - SET ANSICON=121x90 (121x90) services: - mssql2014 @@ -28,15 +43,14 @@ services: ## Install PHP and composer, and run the appropriate composer command install: - IF EXIST C:\tools\php (SET PHP=0) + # TODO: This is a workaround for https://github.com/chocolatey/choco/issues/1843. Once this is fixed we + # should go back to latest version in appveyor saving ourselves test time + - ps: choco upgrade chocolatey -y --version 0.10.13 --allow-downgrade - ps: >- If ($env:php_ver_target -eq "5.6") { appveyor-retry cinst --params '""/InstallDir:C:\tools\php""' --ignore-checksums -y --forcex86 php --version ((choco search php --exact --all-versions -r | select-string -pattern $env:php_ver_target | sort { [version]($_ -split '\|' | select -last 1) } -Descending | Select-Object -first 1) -replace '[php|]','') - $VC = "vc11" - $PHPBuild = "x86" } Else { appveyor-retry cinst --params '""/InstallDir:C:\tools\php""' --ignore-checksums -y php --version ((choco search php --exact --all-versions -r | select-string -pattern $env:php_ver_target | sort { [version]($_ -split '\|' | select -last 1) } -Descending | Select-Object -first 1) -replace '[php|]','') - $VC = "vc14" - $PHPBuild = "x64" } - appveyor-retry cinst -y sqlite - cd C:\tools\php @@ -53,20 +67,21 @@ install: copy SQLSRV\php_pdo_sqlsrv_56_nts.dll ext\php_pdo_sqlsrv_nts.dll Remove-Item C:\tools\php\* -include .zip } Else { - $DLLVersion = "4.3.0" cd c:\tools\php\ext - $source = "http://windows.php.net/downloads/pecl/releases/sqlsrv/$($DLLVersion)/php_sqlsrv-$($DLLVersion)-$($env:php_ver_target)-nts-vc14-x64.zip" - $destination = "c:\tools\php\ext\php_sqlsrv-$($DLLVersion)-$($env:php_ver_target)-nts-vc14-x64.zip" + $source = "https://windows.php.net/downloads/pecl/releases/sqlsrv/$($env:DLLVersion)/php_sqlsrv-$($env:DLLVersion)-$($env:php_ver_target)-nts-$($env:VC)-$($env:PHPBuild).zip" + $destination = "c:\tools\php\ext\php_sqlsrv-$($env:DLLVersion)-$($env:php_ver_target)-nts-$($env:VC)-$($env:PHPBuild).zip" Invoke-WebRequest $source -OutFile $destination - #appveyor-retry appveyor DownloadFile http://windows.php.net/downloads/pecl/releases/sqlsrv/$($DLLVersion)/php_sqlsrv-$($DLLVersion)-$($env:php_ver_target)-nts-vc14-x64.zip - 7z x -y php_sqlsrv-$($DLLVersion)-$($env:php_ver_target)-nts-vc14-x64.zip > $null - $source = "http://windows.php.net/downloads/pecl/releases/pdo_sqlsrv/$($DLLVersion)/php_pdo_sqlsrv-$($DLLVersion)-$($env:php_ver_target)-nts-vc14-x64.zip" - $destination = "c:\tools\php\ext\php_pdo_sqlsrv-$($DLLVersion)-$($env:php_ver_target)-nts-vc14-x64.zip" + #appveyor-retry appveyor DownloadFile https://windows.php.net/downloads/pecl/releases/sqlsrv/$($env:DLLVersion)/php_sqlsrv-$($env:DLLVersion)-$($env:php_ver_target)-nts-$($env:VC)-$($env:PHPBuild).zip + 7z x -y php_sqlsrv-$($env:DLLVersion)-$($env:php_ver_target)-nts-$($env:VC)-$($env:PHPBuild).zip > $null + $source = "https://windows.php.net/downloads/pecl/releases/pdo_sqlsrv/$($env:DLLVersion)/php_pdo_sqlsrv-$($env:DLLVersion)-$($env:php_ver_target)-nts-$($env:VC)-$($env:PHPBuild).zip" + $destination = "c:\tools\php\ext\php_pdo_sqlsrv-$($env:DLLVersion)-$($env:php_ver_target)-nts-$($env:VC)-$($env:PHPBuild).zip" Invoke-WebRequest $source -OutFile $destination - #appveyor-retry appveyor DownloadFile http://windows.php.net/downloads/pecl/releases/pdo_sqlsrv/$($DLLVersion)/php_pdo_sqlsrv-$($DLLVersion)-$($env:php_ver_target)-nts-vc14-x64.zip - 7z x -y php_pdo_sqlsrv-$($DLLVersion)-$($env:php_ver_target)-nts-vc14-x64.zip > $null + #appveyor-retry appveyor DownloadFile https://windows.php.net/downloads/pecl/releases/pdo_sqlsrv/$($env:DLLVersion)/php_pdo_sqlsrv-$($env:DLLVersion)-$($env:php_ver_target)-nts-$($env:VC)-$($env:PHPBuild).zip + 7z x -y php_pdo_sqlsrv-$($env:DLLVersion)-$($env:php_ver_target)-nts-$($env:VC)-$($env:PHPBuild).zip > $null Remove-Item c:\tools\php\ext* -include .zip - cd c:\tools\php}} + cd c:\tools\php + } + } - IF %PHP%==1 copy php.ini-production php.ini /Y - IF %PHP%==1 echo date.timezone="UTC" >> php.ini - IF %PHP%==1 echo extension_dir=ext >> php.ini @@ -94,18 +109,19 @@ install: - IF %PHP%==1 echo extension=php_curl.dll >> php.ini # Get the Wincache DLLs - ps: >- - If ($env:PHP -eq "1") { - If ($env:php_ver_target -eq "5.6") {$wincache = "1.3.7.12"} Else {$wincache = "2.0.0.8"} + If ($env:PHP -eq "1" -and $env:WINCACHE) { cd c:\tools\php\ext - $source = "http://windows.php.net/downloads/pecl/releases/wincache/$($wincache)/php_wincache-$($wincache)-$($env:php_ver_target)-nts-$($VC)-$($PHPBuild).zip" - $destination = "c:\tools\php\ext\php_wincache-$($wincache)-$($env:php_ver_target)-nts-$($VC)-$($PHPBuild).zip" + $source = "https://windows.php.net/downloads/pecl/releases/wincache/$($env:WINCACHE)/php_wincache-$($env:WINCACHE)-$($env:php_ver_target)-nts-$($env:VC)-$($env:PHPBuild).zip" + $destination = "c:\tools\php\ext\php_wincache-$($env:WINCACHE)-$($env:php_ver_target)-nts-$($env:VC)-$($env:PHPBuild).zip" Invoke-WebRequest $source -OutFile $destination - #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 + #appveyor-retry appveyor DownloadFile https://windows.php.net/downloads/pecl/releases/wincache/$($env:WINCACHE)/php_wincache-$($env:WINCACHE)-$($env:php_ver_target)-nts-$($env:VC)-$($env:PHPBuild).zip + 7z x -y php_wincache-$($env:WINCACHE)-$($env:php_ver_target)-nts-$($env:VC)-$($env:PHPBuild).zip > $null Remove-Item C:\tools\php\ext* -include .zip - cd c:\tools\php} - - IF %PHP%==1 echo extension=php_wincache.dll >> php.ini - - IF %PHP%==1 echo wincache.enablecli = 1 >> php.ini + cd c:\tools\php + Add-Content php.ini "`nextension=php_wincache.dll" + Add-Content php.ini "`wincache.enablecli = 1" + Add-Content php.ini "`n" + } - IF %PHP%==1 echo zend_extension=php_opcache.dll >> php.ini - IF %PHP%==1 echo opcache.enable_cli=1 >> php.ini - IF %PHP%==1 echo extension=php_ldap.dll >> php.ini diff --git a/.drone.yml b/.drone.yml index de6c6888ae7f0..a98dd08350260 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,21 +1,33 @@ -pipeline: - clone: - image: plugins/git - depth: 1 +--- +kind: pipeline +name: default - phpcs: +clone: + depth: 42 + +steps: + - name: phpcs image: joomlaprojects/docker-phpcs commands: - echo $(date) - /root/.composer/vendor/bin/phpcs --report=full --encoding=utf-8 --extensions=php -p --standard=build/phpcs/Joomla . - echo $(date) - javascript: + - name: restore-cache + image: drillster/drone-volume-cache + settings: + restore: true + mount: + - ./tests/javascript/node_modules + cache_key: [ DRONE_REPO_NAMESPACE, DRONE_REPO_NAME, DRONE_BRANCH, DRONE_STAGE_NUMBER ] + volumes: + - name: cache + path: /cache + + - name: javascript image: joomlaprojects/docker-systemtests:latest commands: - echo $(date) - - apt-get install nodejs npm - - ln -s /usr/bin/nodejs /usr/bin/node - export DISPLAY=:0 - Xvfb -screen 0 1024x768x24 -ac +extension GLX +render -noreset > /dev/null 2>&1 & - sleep 3 @@ -26,29 +38,40 @@ pipeline: - tests/javascript/node_modules/karma/bin/karma start karma.conf.js --single-run - echo $(date) - analysis3x: + - name: rebuild-cache + image: drillster/drone-volume-cache + settings: + rebuild: true + mount: + - ./tests/javascript/node_modules + cache_key: [ DRONE_REPO_NAMESPACE, DRONE_REPO_NAME, DRONE_BRANCH, DRONE_STAGE_NUMBER ] + volumes: + - name: cache + path: /cache + + - name: analysis3x image: rips/rips-cli:1.2.1 - secrets: [rips_username, rips_password] when: branch: staging commands: - export RIPS_BASE_URI='https://api.rips.joomla.org' - - export RIPS_USERNAME=$RIPS_USERNAME - - export RIPS_PASSWORD=$RIPS_PASSWORD - - if [ $DRONE_REPO_OWNER != 'joomla' ]; then echo "The analysis check only run on the main repos"; exit 0; fi - - rips-cli rips:scan:start -a 1 -t 1 -p $(pwd) -t 1 -R -k -T $DRONE_REPO_OWNER-$DRONE_BRANCH || { echo "Please contact the security team at security@joomla.org"; exit 1; } + - if [ $DRONE_REPO_NAMESPACE != 'joomla' ]; then echo "The analysis check only run on the main repos"; exit 0; fi + - rips-cli rips:scan:start -a 1 -t 1 -p $(pwd) -t 1 -R -k -T $DRONE_REPO_NAMESPACE-$DRONE_BRANCH || { echo "Please contact the security team at security@joomla.org"; exit 1; } + environment: + RIPS_USERNAME: + from_secret: RIPS_USERNAME + RIPS_PASSWORD: + from_secret: RIPS_PASSWORD - analysis4x: - image: rips/rips-cli:1.2.1 - secrets: [rips_username, rips_password] - when: - branch: 4.0-dev - commands: - - export RIPS_BASE_URI='https://api.rips.joomla.org' - - export RIPS_USERNAME=$RIPS_USERNAME - - export RIPS_PASSWORD=$RIPS_PASSWORD - - if [ $DRONE_REPO_OWNER != 'joomla' ]; then echo "The analysis check only run on the main repos"; exit 0; fi - - rips-cli rips:scan:start -a 3 -t 1 -p $(pwd) -t 1 -R -k -T $DRONE_REPO_OWNER-$DRONE_BRANCH || { echo "Please contact the security team at security@joomla.org"; exit 1; } +volumes: +- name: cache + host: + path: /tmp/cache branches: exclude: [ l10n_* ] +--- +kind: signature +hmac: e3e6739c960a689e78ec07c0ea193818796cdcf3c3dab9781f7f07b7e3e6b674 + +... diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 2e11672963b22..46edbbe030714 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -35,7 +35,7 @@ libraries/src/Updater/* @rdeutz @wilsonge @zero-24 build/jenkins/* @rdeutz build/travis/* @rdeutz tests/codeception/* @rdeutz -tests/javascript/* @dgrammatiko @rdeutz +tests/javascript/* @wilsonge @rdeutz tests/unit/* @rdeutz .appveyor.yml @rdeutz .drone.yml @rdeutz @@ -43,11 +43,11 @@ tests/unit/* @rdeutz .travis.yml @rdeutz appveyor-phpunit.xml @rdeutz codeception.yml @rdeutz -karma.conf.js @dgrammatiko @rdeutz +karma.conf.js @wilsonge @rdeutz phpunit.xml.dist @rdeutz RoboFile.dist.ini @rdeutz RoboFile.php @rdeutz travis-phpunit.xml @rdeutz # Core JS -media/*/js/* @dgrammatiko +media/*/js/* @wilsonge diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000000000..0be9be57ae051 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +custom: https://community.joomla.org/sponsorship-campaigns.html diff --git a/SECURITY.md b/.github/SECURITY.md similarity index 87% rename from SECURITY.md rename to .github/SECURITY.md index 449c2a5978fdd..52af74f0b6c0a 100644 --- a/SECURITY.md +++ b/.github/SECURITY.md @@ -9,9 +9,7 @@ This document outlines security procedures and policies for the `Joomla! Project ## Reporting a Bug -The `Joomla` team and community take all security bugs in `Joomla` seriously. - -The Joomla! Project takes security vulnerabilities very seriously. As such, the Joomla! Security Strike Team (JSST) oversees the project's security issues and follows some specific procedures when dealing with these issues. +The `Joomla` team and community take all security bugs in `Joomla` seriously. The Joomla! Security Strike Team (JSST) oversees the project's security issues and follows some specific procedures when dealing with these issues. If you find a possible vulnerability, please report it to the JSST using the [online form](https://developer.joomla.org/security/contact-the-team.html) or via email at security@joomla.org @@ -25,7 +23,7 @@ Thank you for improving the security of `Joomla`. ## Response Handling -The JSST aims to ensure all issues are handled in a timely manner and for clear communication between the team and issue reporters. As such, we have established the following guidelines for responding to issue reports: +The JSST aims to ensure all issues are handled in a timely manner and for clear communication between the team and issue reporters. We have established the following guidelines for responding to issue reports: * Within 24 hours every report gets acknowledged * Within 7 days every report gets a further response stating either diff --git a/.gitignore b/.gitignore index e827b20531ff9..5d82596f77fa7 100644 --- a/.gitignore +++ b/.gitignore @@ -184,6 +184,9 @@ Desktop.ini /libraries/vendor/symfony/polyfill-util/LegacyTestListener.php /libraries/vendor/symfony/polyfill-util/TestListener.php /libraries/vendor/symfony/polyfill-util/TestListenerTrait.php +/libraries/vendor/symfony/polyfill-util/TestListenerForV5.php +/libraries/vendor/symfony/polyfill-util/TestListenerForV6.php +/libraries/vendor/symfony/polyfill-util/TestListenerForV7.php /libraries/vendor/symfony/yaml/Tests /libraries/vendor/symfony/yaml/.gitignore /libraries/vendor/symfony/yaml/CHANGELOG.md @@ -201,6 +204,7 @@ Desktop.ini /libraries/vendor/simplepie/simplepie/idn/ReadMe.txt /libraries/vendor/simplepie/simplepie/composer.json /libraries/vendor/typo3/phar-stream-wrapper/tests +/libraries/vendor/typo3/phar-stream-wrapper/.appveyor.yml /libraries/vendor/typo3/phar-stream-wrapper/.gitattributes /libraries/vendor/typo3/phar-stream-wrapper/.gitignore /libraries/vendor/typo3/phar-stream-wrapper/.travis.yml diff --git a/.travis.yml b/.travis.yml index f384a2d541a51..7e16b322c1b61 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,43 +6,51 @@ language: php env: global: - RUN_UNIT_TESTS="yes" - - INSTALL_MEMCACHE="yes" + - INSTALL_APCU="yes" - INSTALL_MEMCACHED="yes" - INSTALL_REDIS="yes" matrix: fast_finish: true include: - - php: 7.0 - env: INSTALL_APCU="yes" INSTALL_MEMCACHE="no" - - php: 7.1 - env: INSTALL_APCU="yes" INSTALL_MEMCACHE="no" # Requires older Precise image - php: 5.3 - env: INSTALL_APC="yes" + env: + - INSTALL_APC="yes" + - INSTALL_APCU="no" + - INSTALL_MEMCACHE="yes" sudo: true dist: precise # The new Trusty image has issues with running APC, do not enable it here - php: 5.4 - env: INSTALL_APC="no" + env: + - INSTALL_APCU="no" + - INSTALL_MEMCACHE="yes" + dist: trusty - php: 5.5 - env: INSTALL_APCU="yes" + env: + - INSTALL_MEMCACHE="yes" + dist: trusty - php: 5.6 - env: INSTALL_APCU="yes" + env: + - INSTALL_MEMCACHE="yes" + dist: trusty + - php: 7.0 + - php: 7.1 - php: 7.2 - env: INSTALL_APCU="yes" INSTALL_MEMCACHE="no" - php: 7.3 - env: INSTALL_APCU="yes" INSTALL_MEMCACHE="no" INSTALL_MEMCACHED="no" + - php: 7.4snapshot - php: nightly - env: INSTALL_APCU="no" INSTALL_MEMCACHE="no" INSTALL_MEMCACHED="no" allow_failures: - - php: 7.3 + - php: 7.4snapshot - php: nightly services: - memcache - memcached - redis-server + - mysql + - postgresql before_script: # Make sure all dev dependencies are installed diff --git a/README.md b/README.md index 90377c8f2a282..f5f4ef48d15e1 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Build Status --------------------- | Travis-CI | Drone-CI | AppVeyor | | ------------- | ------------- | ------------- | -| [![Build Status](https://travis-ci.org/joomla/joomla-cms.svg?branch=staging)](https://travis-ci.org/joomla/joomla-cms) | [![Build Status](http://213.160.72.75/api/badges/joomla/joomla-cms/status.svg)](http://213.160.72.75/joomla/joomla-cms) | [![Build status](https://ci.appveyor.com/api/projects/status/bpcxulw6nnxlv8kb/branch/staging?svg=true)](https://ci.appveyor.com/project/joomla/joomla-cms) | +| [![Build Status](https://travis-ci.org/joomla/joomla-cms.svg?branch=staging)](https://travis-ci.org/joomla/joomla-cms) | [![Build Status](https://ci.joomla.org/api/badges/joomla/joomla-cms/status.svg)](https://ci.joomla.org/joomla/joomla-cms) | [![Build status](https://ci.appveyor.com/api/projects/status/ru6sxal8jmfckvjc/branch/staging?svg=true)](https://ci.appveyor.com/project/release-joomla/joomla-cms) | What is this? --------------------- @@ -87,6 +87,5 @@ Do you want to improve Joomla? Copyright --------------------- * Copyright (C) 2005 - 2019 Open Source Matters. All rights reserved. -* [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/Special:MyLanguage/Joomla_Licenses) diff --git a/README.txt b/README.txt index 5b99b26e7b314..bfe1f7663c870 100644 --- a/README.txt +++ b/README.txt @@ -67,6 +67,5 @@ Copyright: * Copyright (C) 2005 - 2019 Open Source Matters. All rights reserved. - * 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/Special:MyLanguage/Joomla_Licenses + * See License details at https://docs.joomla.org/Special:MyLanguage/Joomla_Licenses diff --git a/administrator/components/com_actionlogs/helpers/actionlogs.php b/administrator/components/com_actionlogs/helpers/actionlogs.php index 71221c4de0697..7a03bea2ec9f8 100644 --- a/administrator/components/com_actionlogs/helpers/actionlogs.php +++ b/administrator/components/com_actionlogs/helpers/actionlogs.php @@ -23,6 +23,14 @@ */ class ActionlogsHelper { + /** + * Array of characters starting a formula + * + * @var array + * @since 3.9.7 + */ + private static $characters = array('=', '+', '-', '@'); + /** * Method to convert logs objects array to an iterable type for use with a CSV export * @@ -54,6 +62,8 @@ public static function getCsvData($data) return ActionlogsHelperPhp55::getCsvAsGenerator($data); } + $disabledText = Text::_('COM_ACTIONLOGS_DISABLED'); + $rows = array(); // Header row @@ -68,11 +78,11 @@ public static function getCsvData($data) $rows[] = array( 'id' => $log->id, - 'message' => strip_tags(static::getHumanReadableLogMessage($log, false)), + 'message' => self::escapeCsvFormula(strip_tags(static::getHumanReadableLogMessage($log, false))), 'date' => $date->format('Y-m-d H:i:s T'), - 'extension' => Text::_($extension), - 'name' => $log->name, - 'ip_address' => Text::_($log->ip_address), + 'extension' => self::escapeCsvFormula(Text::_($extension)), + 'name' => self::escapeCsvFormula($log->name), + 'ip_address' => self::escapeCsvFormula($log->ip_address === 'COM_ACTIONLOGS_DISABLED' ? $disabledText : $log->ip_address) ); } @@ -193,7 +203,19 @@ public static function getHumanReadableLogMessage($log, $generateLinks = true) $messageData['extension_name'] = Text::_($messageData['extension_name']); } - $linkMode = Factory::getApplication()->get('force_ssl', 0) >= 1 ? 1 : -1; + // Translating application + if (isset($messageData['app'])) + { + $messageData['app'] = Text::_($messageData['app']); + } + + // Translating type + if (isset($messageData['type'])) + { + $messageData['type'] = Text::_($messageData['type']); + } + + $linkMode = Factory::getApplication()->get('force_ssl', 0) >= 1 ? Route::TLS_FORCE : Route::TLS_IGNORE; foreach ($messageData as $key => $value) { @@ -208,7 +230,7 @@ public static function getHumanReadableLogMessage($log, $generateLinks = true) $value = $links[$value]; } - $message = str_replace('{' . $key . '}', Text::_($value), $message); + $message = str_replace('{' . $key . '}', $value, $message); } return $message; @@ -327,4 +349,28 @@ public static function loadActionLogPluginsLanguage() // Load com_privacy too. $lang->load('com_privacy', JPATH_ADMINISTRATOR, null, false, true); } + + /** + * Escapes potential characters that start a formula in a CSV value to prevent injection attacks + * + * @param mixed $value csv field value + * + * @return mixed + * + * @since 3.9.7 + */ + protected static function escapeCsvFormula($value) + { + if ($value == '') + { + return $value; + } + + if (in_array($value[0], self::$characters, true)) + { + $value = ' ' . $value; + } + + return $value; + } } diff --git a/administrator/components/com_actionlogs/helpers/actionlogsphp55.php b/administrator/components/com_actionlogs/helpers/actionlogsphp55.php index 0d12ca3d30547..9cca5ee5ff97b 100644 --- a/administrator/components/com_actionlogs/helpers/actionlogsphp55.php +++ b/administrator/components/com_actionlogs/helpers/actionlogsphp55.php @@ -23,6 +23,14 @@ */ class ActionlogsHelperPhp55 { + /** + * Array of characters starting a formula + * + * @var array + * @since 3.9.7 + */ + private static $characters = array('=', '+', '-', '@'); + /** * Method to convert logs objects array to a Generator for use with a CSV export * @@ -46,6 +54,8 @@ public static function getCsvAsGenerator($data) ); } + $disabledText = Text::_('COM_ACTIONLOGS_DISABLED'); + // Header row yield array('Id', 'Message', 'Date', 'Extension', 'User', 'Ip'); @@ -57,12 +67,36 @@ public static function getCsvAsGenerator($data) yield array( 'id' => $log->id, - 'message' => strip_tags(ActionlogsHelper::getHumanReadableLogMessage($log, false)), + 'message' => self::escapeCsvFormula(strip_tags(ActionlogsHelper::getHumanReadableLogMessage($log, false))), 'date' => (new Date($log->log_date, new DateTimeZone('UTC')))->format('Y-m-d H:i:s T'), - 'extension' => Text::_($extension), - 'name' => $log->name, - 'ip_address' => Text::_($log->ip_address), + 'extension' => self::escapeCsvFormula(Text::_($extension)), + 'name' => self::escapeCsvFormula($log->name), + 'ip_address' => self::escapeCsvFormula($log->ip_address === 'COM_ACTIONLOGS_DISABLED' ? $disabledText : $log->ip_address) ); } } + + /** + * Escapes potential characters that start a formula in a CSV value to prevent injection attacks + * + * @param mixed $value csv field value + * + * @return mixed + * + * @since 3.9.7 + */ + protected static function escapeCsvFormula($value) + { + if ($value == '') + { + return $value; + } + + if (in_array($value[0], self::$characters, true)) + { + $value = ' ' . $value; + } + + return $value; + } } diff --git a/administrator/components/com_actionlogs/models/fields/extension.php b/administrator/components/com_actionlogs/models/fields/extension.php index e72eae7c53e24..a26057ba665af 100644 --- a/administrator/components/com_actionlogs/models/fields/extension.php +++ b/administrator/components/com_actionlogs/models/fields/extension.php @@ -4,7 +4,7 @@ * @subpackage com_actionlogs * * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; diff --git a/administrator/components/com_actionlogs/models/fields/logcreator.php b/administrator/components/com_actionlogs/models/fields/logcreator.php index def002b19722f..3668c1d62b32e 100644 --- a/administrator/components/com_actionlogs/models/fields/logcreator.php +++ b/administrator/components/com_actionlogs/models/fields/logcreator.php @@ -4,7 +4,7 @@ * @subpackage com_actionlogs * * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; @@ -60,12 +60,12 @@ protected function getOptions() // Construct the query $query = $db->getQuery(true) ->select($db->quoteName('u.id', 'value')) - ->select($db->quoteName('u.name', 'text')) + ->select($db->quoteName('u.username', 'text')) ->from($db->quoteName('#__users', 'u')) ->join('INNER', $db->quoteName('#__action_logs', 'c') . ' ON ' . $db->quoteName('c.user_id') . ' = ' . $db->quoteName('u.id')) ->group($db->quoteName('u.id')) - ->group($db->quoteName('u.name')) - ->order($db->quoteName('u.name')); + ->group($db->quoteName('u.username')) + ->order($db->quoteName('u.username')); // Setup the query $db->setQuery($query); diff --git a/administrator/components/com_actionlogs/models/fields/logsdaterange.php b/administrator/components/com_actionlogs/models/fields/logsdaterange.php index 970c1664981f2..346858c256f11 100644 --- a/administrator/components/com_actionlogs/models/fields/logsdaterange.php +++ b/administrator/components/com_actionlogs/models/fields/logsdaterange.php @@ -4,7 +4,7 @@ * @subpackage com_actionlogs * * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; diff --git a/administrator/components/com_actionlogs/models/fields/logtype.php b/administrator/components/com_actionlogs/models/fields/logtype.php index 7764e26cb9747..1634648afb9ef 100644 --- a/administrator/components/com_actionlogs/models/fields/logtype.php +++ b/administrator/components/com_actionlogs/models/fields/logtype.php @@ -4,7 +4,7 @@ * @subpackage System.actionlogs * * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; diff --git a/administrator/components/com_admin/models/forms/profile.xml b/administrator/components/com_admin/models/forms/profile.xml index 4c451639facb3..02ae043bafbb1 100644 --- a/administrator/components/com_admin/models/forms/profile.xml +++ b/administrator/components/com_admin/models/forms/profile.xml @@ -143,15 +143,6 @@ - - - - isDir() || $folder->isDot()) + if ($folder->isDot() || !$folder->isDir()) { continue; } @@ -546,7 +546,7 @@ public function getDirectory($public = false) foreach ($manifests as $folder) { - if (!$folder->isDir() || $folder->isDot()) + if ($folder->isDot() || !$folder->isDir()) { continue; } @@ -569,7 +569,7 @@ public function getDirectory($public = false) foreach ($image_folders as $folder) { - if (!$folder->isDir() || $folder->isDot()) + if ($folder->isDot() || !$folder->isDir()) { continue; } @@ -587,7 +587,7 @@ public function getDirectory($public = false) foreach ($site_langs as $folder) { - if (!$folder->isDir() || $folder->isDot()) + if ($folder->isDot() || !$folder->isDir()) { continue; } @@ -605,7 +605,7 @@ public function getDirectory($public = false) foreach ($plugin_groups as $folder) { - if (!$folder->isDir() || $folder->isDot()) + if ($folder->isDot() || !$folder->isDir()) { continue; } diff --git a/administrator/components/com_admin/postinstall/joomla40checks.php b/administrator/components/com_admin/postinstall/joomla40checks.php index ac010815d8fc0..99827785c134f 100644 --- a/administrator/components/com_admin/postinstall/joomla40checks.php +++ b/administrator/components/com_admin/postinstall/joomla40checks.php @@ -20,6 +20,7 @@ * * @link https://developer.joomla.org/news/658-joomla4-manifesto.html * @link https://developer.joomla.org/news/704-looking-forward-with-joomla-4.html + * @link https://developer.joomla.org/news/788-joomla-4-on-the-move.html */ function admin_postinstall_joomla40checks_condition() { @@ -33,15 +34,27 @@ function admin_postinstall_joomla40checks_condition() return true; } - if ($serverType == 'postgresql' && version_compare($serverVersion, '9.2', 'lt')) + if ($serverType == 'postgresql' && version_compare($serverVersion, '11.0', 'lt')) { - // PostgreSQL minimum version is 9.2 + // PostgreSQL minimum version is 11.0 return true; } - if ($serverType == 'mysql' && version_compare($serverVersion, '5.5.3', 'lt')) + // Check whether we have a MariaDB version string and extract the proper version from it + if ($serverType == 'mysql' && stripos($serverVersion, 'mariadb') !== false) { - // MySQL minimum version is 5.5.3 + $serverVersion = preg_replace('/^5\.5\.5-/', '', $serverVersion); + + // MariaDB minimum version is 10.1 + if (version_compare($serverVersion, '10.1', 'lt')) + { + return true; + } + } + + if ($serverType == 'mysql' && version_compare($serverVersion, '5.6', 'lt')) + { + // MySQL minimum version is 5.6.0 return true; } @@ -57,6 +70,6 @@ function admin_postinstall_joomla40checks_condition() return true; } - // PHP minimum version is 7.0 - return version_compare(PHP_VERSION, '7.0', 'lt'); + // PHP minimum version is 7.2 + return version_compare(PHP_VERSION, '7.2', 'lt'); } diff --git a/administrator/components/com_admin/script.php b/administrator/components/com_admin/script.php index ef7e1da1a2125..1917f33e9feea 100644 --- a/administrator/components/com_admin/script.php +++ b/administrator/components/com_admin/script.php @@ -1968,7 +1968,10 @@ public function deleteUnexistingFiles() /* * Joomla! 3.8.0 thru 3.9.0 */ + '/administrator/components/com_users/controllers/profile.json.php', '/administrator/includes/toolbar.php', + '/components/com_users/controllers/profile_base_json.php', + '/components/com_users/controllers/profile.json.php', '/libraries/joomla/filesystem/file.php', '/libraries/joomla/filesystem/folder.php', '/libraries/joomla/filesystem/helper.php', @@ -1984,6 +1987,15 @@ public function deleteUnexistingFiles() '/libraries/src/Mail/language/phpmailer.lang-joomla.php', '/plugins/captcha/recaptcha/recaptchalib.php', + /* + * Joomla! 3.9.0 thru 3.10.0 + */ + '/SECURITY.md', + '/administrator/components/com_users/controllers/profile.json.php', + '/components/com_users/controllers/profile.json.php', + '/components/com_users/controllers/profile_base_json.php', + '/tests/unit/suites/libraries/cms/form/field/JFormFieldHelpsiteTest.php', + /* * Legacy FOF */ @@ -2010,6 +2022,11 @@ public function deleteUnexistingFiles() '/libraries/fof/view.html.php', '/libraries/fof/view.json.php', '/libraries/fof/view.php', + + /* + * Joomla! 3.9.7 + */ + '/administrator/components/com_joomlaupdate/access.xml', ); // TODO There is an issue while deleting folders using the ftp mode diff --git a/administrator/components/com_admin/sql/updates/mysql/3.9.10-2019-07-09.sql b/administrator/components/com_admin/sql/updates/mysql/3.9.10-2019-07-09.sql new file mode 100644 index 0000000000000..3738ee367d0ac --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/3.9.10-2019-07-09.sql @@ -0,0 +1 @@ +ALTER TABLE `#__template_styles` MODIFY `home` char(7) NOT NULL DEFAULT '0'; diff --git a/administrator/components/com_admin/sql/updates/mysql/3.9.7-2019-04-23.sql b/administrator/components/com_admin/sql/updates/mysql/3.9.7-2019-04-23.sql new file mode 100644 index 0000000000000..8250cfbcb04e7 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/3.9.7-2019-04-23.sql @@ -0,0 +1 @@ +ALTER TABLE `#__session` ADD INDEX `client_id_guest` (`client_id`, `guest`); diff --git a/administrator/components/com_admin/sql/updates/mysql/3.9.7-2019-04-26.sql b/administrator/components/com_admin/sql/updates/mysql/3.9.7-2019-04-26.sql new file mode 100644 index 0000000000000..5a13011beeae1 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/3.9.7-2019-04-26.sql @@ -0,0 +1 @@ +UPDATE `#__content_types` SET `content_history_options` = REPLACE(`content_history_options`, '\"ignoreChanges\":[\"modified_by\", \"modified\", \"checked_out\", \"checked_out_time\", \"version\", \"hits\"]', '\"ignoreChanges\":[\"modified_by\", \"modified\", \"checked_out\", \"checked_out_time\", \"version\", \"hits\", \"ordering\"]'); diff --git a/administrator/components/com_admin/sql/updates/mysql/3.9.7-2019-05-16.sql b/administrator/components/com_admin/sql/updates/mysql/3.9.7-2019-05-16.sql new file mode 100644 index 0000000000000..e03422239c89e --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/3.9.7-2019-05-16.sql @@ -0,0 +1 @@ +# Query removed, see https://github.com/joomla/joomla-cms/pull/25177 diff --git a/administrator/components/com_admin/sql/updates/mysql/3.9.8-2019-06-11.sql b/administrator/components/com_admin/sql/updates/mysql/3.9.8-2019-06-11.sql new file mode 100644 index 0000000000000..61d79e585edb8 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/3.9.8-2019-06-11.sql @@ -0,0 +1 @@ +UPDATE #__users SET params = REPLACE(params, '",,"', '","'); \ No newline at end of file diff --git a/administrator/components/com_admin/sql/updates/mysql/3.9.8-2019-06-15.sql b/administrator/components/com_admin/sql/updates/mysql/3.9.8-2019-06-15.sql new file mode 100644 index 0000000000000..33df450aa00ca --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/3.9.8-2019-06-15.sql @@ -0,0 +1,4 @@ +ALTER TABLE `#__template_styles` DROP INDEX `idx_home`; +# Query removed, see https://github.com/joomla/joomla-cms/pull/25484 +ALTER TABLE `#__template_styles` ADD INDEX `idx_client_id` (`client_id`); +ALTER TABLE `#__template_styles` ADD INDEX `idx_client_id_home` (`client_id`, `home`); diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.9.10-2019-07-09.sql b/administrator/components/com_admin/sql/updates/postgresql/3.9.10-2019-07-09.sql new file mode 100644 index 0000000000000..b1a394cd5c582 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/3.9.10-2019-07-09.sql @@ -0,0 +1,2 @@ +ALTER TABLE "#__template_styles" ALTER COLUMN "home" TYPE character varying(7); +ALTER TABLE "#__template_styles" ALTER COLUMN "home" SET DEFAULT '0'; diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.9.7-2019-04-23.sql b/administrator/components/com_admin/sql/updates/postgresql/3.9.7-2019-04-23.sql new file mode 100644 index 0000000000000..88dc5d39f8d5e --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/3.9.7-2019-04-23.sql @@ -0,0 +1 @@ +CREATE INDEX "#__session_idx_client_id_guest" ON "#__session" ("client_id", "guest"); diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.9.7-2019-04-26.sql b/administrator/components/com_admin/sql/updates/postgresql/3.9.7-2019-04-26.sql new file mode 100644 index 0000000000000..0439a87b08e84 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/3.9.7-2019-04-26.sql @@ -0,0 +1 @@ +UPDATE "#__content_types" SET "content_history_options" = REPLACE("content_history_options", '\"ignoreChanges\":[\"modified_by\", \"modified\", \"checked_out\", \"checked_out_time\", \"version\", \"hits\"]', '\"ignoreChanges\":[\"modified_by\", \"modified\", \"checked_out\", \"checked_out_time\", \"version\", \"hits\", \"ordering\"]'); diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.9.7-2019-05-16.sql b/administrator/components/com_admin/sql/updates/postgresql/3.9.7-2019-05-16.sql new file mode 100644 index 0000000000000..e03422239c89e --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/3.9.7-2019-05-16.sql @@ -0,0 +1 @@ +# Query removed, see https://github.com/joomla/joomla-cms/pull/25177 diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.9.8-2019-06-11.sql b/administrator/components/com_admin/sql/updates/postgresql/3.9.8-2019-06-11.sql new file mode 100644 index 0000000000000..018e8d73c3bde --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/3.9.8-2019-06-11.sql @@ -0,0 +1 @@ +UPDATE "#__users" SET "params" = REPLACE("params", '",,"', '","'); \ No newline at end of file diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.9.8-2019-06-15.sql b/administrator/components/com_admin/sql/updates/postgresql/3.9.8-2019-06-15.sql new file mode 100644 index 0000000000000..3acf06149c527 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/3.9.8-2019-06-15.sql @@ -0,0 +1,4 @@ +DROP INDEX IF EXISTS "#__template_styles_idx_home"; +# Queries removed, see https://github.com/joomla/joomla-cms/pull/25484 +CREATE INDEX "#__template_styles_idx_client_id" ON "#__template_styles" ("client_id"); +CREATE INDEX "#__template_styles_idx_client_id_home" ON "#__template_styles" ("client_id", "home"); diff --git a/administrator/components/com_admin/sql/updates/sqlazure/3.9.10-2019-07-09.sql b/administrator/components/com_admin/sql/updates/sqlazure/3.9.10-2019-07-09.sql new file mode 100644 index 0000000000000..af8f28708f799 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/sqlazure/3.9.10-2019-07-09.sql @@ -0,0 +1,2 @@ +ALTER TABLE [#__template_styles] ALTER COLUMN [home] nvarchar(7) NOT NULL; +ALTER TABLE [#__template_styles] ADD DEFAULT ('0') FOR [home]; diff --git a/administrator/components/com_admin/sql/updates/sqlazure/3.9.7-2019-04-23.sql b/administrator/components/com_admin/sql/updates/sqlazure/3.9.7-2019-04-23.sql new file mode 100644 index 0000000000000..bcbd0ef4e0187 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/sqlazure/3.9.7-2019-04-23.sql @@ -0,0 +1,5 @@ +CREATE NONCLUSTERED INDEX [idx_client_id_guest] ON [#__session] +( + [client_id] ASC, + [guest] ASC +)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); diff --git a/administrator/components/com_admin/sql/updates/sqlazure/3.9.7-2019-04-26.sql b/administrator/components/com_admin/sql/updates/sqlazure/3.9.7-2019-04-26.sql new file mode 100644 index 0000000000000..e76f02ae398bf --- /dev/null +++ b/administrator/components/com_admin/sql/updates/sqlazure/3.9.7-2019-04-26.sql @@ -0,0 +1 @@ +UPDATE [#__content_types] SET [content_history_options] = REPLACE([content_history_options], '\"ignoreChanges\":[\"modified_by\", \"modified\", \"checked_out\", \"checked_out_time\", \"version\", \"hits\"]', '\"ignoreChanges\":[\"modified_by\", \"modified\", \"checked_out\", \"checked_out_time\", \"version\", \"hits\", \"ordering\"]'); diff --git a/administrator/components/com_admin/sql/updates/sqlazure/3.9.7-2019-05-16.sql b/administrator/components/com_admin/sql/updates/sqlazure/3.9.7-2019-05-16.sql new file mode 100644 index 0000000000000..e03422239c89e --- /dev/null +++ b/administrator/components/com_admin/sql/updates/sqlazure/3.9.7-2019-05-16.sql @@ -0,0 +1 @@ +# Query removed, see https://github.com/joomla/joomla-cms/pull/25177 diff --git a/administrator/components/com_admin/sql/updates/sqlazure/3.9.8-2019-06-11.sql b/administrator/components/com_admin/sql/updates/sqlazure/3.9.8-2019-06-11.sql new file mode 100644 index 0000000000000..caefb45bd147d --- /dev/null +++ b/administrator/components/com_admin/sql/updates/sqlazure/3.9.8-2019-06-11.sql @@ -0,0 +1 @@ +UPDATE [#__users] SET [params] = REPLACE([params], '",,"', '","'); \ No newline at end of file diff --git a/administrator/components/com_admin/sql/updates/sqlazure/3.9.8-2019-06-15.sql b/administrator/components/com_admin/sql/updates/sqlazure/3.9.8-2019-06-15.sql new file mode 100644 index 0000000000000..67aef81054044 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/sqlazure/3.9.8-2019-06-15.sql @@ -0,0 +1,12 @@ +DROP INDEX [idx_home] ON [#__template_styles]; +# Query removed, see https://github.com/joomla/joomla-cms/pull/25484 +CREATE NONCLUSTERED INDEX [idx_client_id] ON [#__template_styles] +( + [client_id] ASC +)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); +CREATE NONCLUSTERED INDEX [idx_client_id_home] ON [#__template_styles] +( + [client_id] ASC, + [home] ASC +)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); +ALTER TABLE [#__template_styles] ADD DEFAULT (0) FOR [home]; diff --git a/administrator/components/com_associations/views/association/tmpl/edit.php b/administrator/components/com_associations/views/association/tmpl/edit.php index 9456a8d8570a4..3cc2a61ba436d 100644 --- a/administrator/components/com_associations/views/association/tmpl/edit.php +++ b/administrator/components/com_associations/views/association/tmpl/edit.php @@ -39,6 +39,7 @@ data-item="typeName; ?>" data-id="referenceId; ?>" data-title="referenceTitle; ?>" + data-title-value="referenceTitleValue; ?>" data-language="referenceLanguage; ?>" data-editurl="editUri); ?>"> diff --git a/administrator/components/com_associations/views/association/view.html.php b/administrator/components/com_associations/views/association/view.html.php index 7e6bd97b222ae..f2b8939cd53fd 100644 --- a/administrator/components/com_associations/views/association/view.html.php +++ b/administrator/components/com_associations/views/association/view.html.php @@ -109,8 +109,9 @@ public function display($tpl = null) $referenceId = $input->get('id', 0, 'int'); $reference = ArrayHelper::fromObject(AssociationsHelper::getItem($extensionName, $typeName, $referenceId)); - $this->referenceLanguage = $reference[$languageField]; - $this->referenceTitle = AssociationsHelper::getTypeFieldName($extensionName, $typeName, 'title'); + $this->referenceLanguage = $reference[$languageField]; + $this->referenceTitle = AssociationsHelper::getTypeFieldName($extensionName, $typeName, 'title'); + $this->referenceTitleValue = $reference[$this->referenceTitle]; $options = array( 'option' => $typeName === 'category' ? 'com_categories' : $extensionName, diff --git a/administrator/components/com_banners/models/banner.php b/administrator/components/com_banners/models/banner.php index 76f5464c0e3a9..c72485e8409f0 100644 --- a/administrator/components/com_banners/models/banner.php +++ b/administrator/components/com_banners/models/banner.php @@ -106,20 +106,17 @@ protected function batchClient($value, $pks, $contexts) */ protected function canDelete($record) { - if (!empty($record->id)) + if (empty($record->id) || $record->state != -2) { - if ($record->state != -2) - { - return false; - } - - if (!empty($record->catid)) - { - return JFactory::getUser()->authorise('core.delete', 'com_banners.category.' . (int) $record->catid); - } + return false; + } - return parent::canDelete($record); + if (!empty($record->catid)) + { + return JFactory::getUser()->authorise('core.delete', 'com_banners.category.' . (int) $record->catid); } + + return parent::canDelete($record); } /** @@ -383,6 +380,9 @@ protected function preprocessForm(JForm $form, $data, $group = 'content') if ($this->canCreateCategory()) { $form->setFieldAttribute('catid', 'allowAdd', 'true'); + + // Add a prefix for categories created on the fly. + $form->setFieldAttribute('catid', 'customPrefix', '#new#'); } parent::preprocessForm($form, $data, $group); @@ -403,20 +403,22 @@ public function save($data) JLoader::register('CategoriesHelper', JPATH_ADMINISTRATOR . '/components/com_categories/helpers/categories.php'); - // Cast catid to integer for comparison - $catid = (int) $data['catid']; + // Create new category, if needed. + $createCategory = true; - // Check if New Category exists - if ($catid > 0) + // If category ID is provided, check if it's valid. + if (is_numeric($data['catid']) && $data['catid']) { - $catid = CategoriesHelper::validateCategoryId($data['catid'], 'com_banners'); + $createCategory = !CategoriesHelper::validateCategoryId($data['catid'], 'com_banners'); } // Save New Category - if ($catid == 0 && $this->canCreateCategory()) + if ($createCategory && $this->canCreateCategory()) { $table = array(); - $table['title'] = $data['catid']; + + // Remove #new# prefix, if exists. + $table['title'] = strpos($data['catid'], '#new#') === 0 ? substr($data['catid'], 5) : $data['catid']; $table['parent_id'] = 1; $table['extension'] = 'com_banners'; $table['language'] = $data['language']; diff --git a/administrator/components/com_banners/models/client.php b/administrator/components/com_banners/models/client.php index ba7d65159420f..796b939d23db9 100644 --- a/administrator/components/com_banners/models/client.php +++ b/administrator/components/com_banners/models/client.php @@ -35,22 +35,17 @@ class BannersModelClient extends JModelAdmin */ protected function canDelete($record) { - if (!empty($record->id)) + if (empty($record->id) || $record->state != -2) { - if ($record->state != -2) - { - return false; - } - - $user = JFactory::getUser(); - - if (!empty($record->catid)) - { - return $user->authorise('core.delete', 'com_banners.category.' . (int) $record->catid); - } + return false; + } - return $user->authorise('core.delete', 'com_banners'); + if (!empty($record->catid)) + { + return JFactory::getUser()->authorise('core.delete', 'com_banners.category.' . (int) $record->catid); } + + return parent::canDelete($record); } /** diff --git a/administrator/components/com_banners/models/tracks.php b/administrator/components/com_banners/models/tracks.php index 9c8f03a325e11..8b0f5ff0c1fa1 100644 --- a/administrator/components/com_banners/models/tracks.php +++ b/administrator/components/com_banners/models/tracks.php @@ -228,7 +228,7 @@ public function delete() $query->where('track_date <= ' . $db->quote($end)); } - $where = '1'; + $where = '1 = 1'; // Filter by client $clientId = $this->getState('filter.client_id'); diff --git a/administrator/components/com_banners/views/banners/tmpl/default_batch_footer.php b/administrator/components/com_banners/views/banners/tmpl/default_batch_footer.php index 14884e6787d28..2895e99922a8a 100644 --- a/administrator/components/com_banners/views/banners/tmpl/default_batch_footer.php +++ b/administrator/components/com_banners/views/banners/tmpl/default_batch_footer.php @@ -12,6 +12,6 @@ - diff --git a/administrator/components/com_categories/models/category.php b/administrator/components/com_categories/models/category.php index 98d5463086a95..ccf73de5d5c60 100644 --- a/administrator/components/com_categories/models/category.php +++ b/administrator/components/com_categories/models/category.php @@ -1018,9 +1018,10 @@ protected function batchCopy($value, $pks, $contexts) } } - // Make a copy of the old ID and Parent ID - $oldId = $this->table->id; + // Make a copy of the old ID, Parent ID and Asset ID + $oldId = $this->table->id; $oldParentId = $this->table->parent_id; + $oldAssetId = $this->table->asset_id; // Reset the id because we are making a copy. $this->table->id = 0; @@ -1063,6 +1064,16 @@ protected function batchCopy($value, $pks, $contexts) // Add the new ID to the array $newIds[$pk] = $newId; + // Copy rules + $query->clear() + ->update($db->quoteName('#__assets', 't')) + ->join('INNER', $db->quoteName('#__assets', 's') . + ' ON ' . $db->quoteName('s.id') . ' = ' . $oldAssetId + ) + ->set($db->quoteName('t.rules') . ' = ' . $db->quoteName('s.rules')) + ->where($db->quoteName('t.id') . ' = ' . $this->table->asset_id); + $db->setQuery($query)->execute(); + // Now we log the old 'parent' to the new 'parent' $parents[$oldId] = $this->table->id; $count--; diff --git a/administrator/components/com_categories/models/fields/categoryedit.php b/administrator/components/com_categories/models/fields/categoryedit.php index e23206766aa7a..ef8006a90eeec 100644 --- a/administrator/components/com_categories/models/fields/categoryedit.php +++ b/administrator/components/com_categories/models/fields/categoryedit.php @@ -28,6 +28,14 @@ class JFormFieldCategoryEdit extends JFormFieldList */ protected $allowAdd; + /** + * Optional prefix for new categories. + * + * @var string + * @since 3.9.11 + */ + protected $customPrefix; + /** * A flexible category list that respects access controls * @@ -57,6 +65,7 @@ public function setup(SimpleXMLElement $element, $value, $group = null) if ($return) { $this->allowAdd = isset($this->element['allowAdd']) ? $this->element['allowAdd'] : ''; + $this->customPrefix = (string) $this->element['customPrefix']; } return $return; @@ -76,6 +85,7 @@ public function __get($name) switch ($name) { case 'allowAdd': + case 'customPrefix': return $this->$name; } @@ -102,6 +112,9 @@ public function __set($name, $value) $value = (string) $value; $this->$name = ($value === 'true' || $value === $name || $value === '1'); break; + case 'customPrefix': + $this->$name = (string) $value; + break; default: parent::__set($name, $value); } @@ -349,6 +362,11 @@ protected function getInput() $attr .= ' data-custom_group_text="' . $customGroupText . '" ' . 'data-no_results_text="' . JText::_('JGLOBAL_ADD_CUSTOM_CATEGORY') . '" ' . 'data-placeholder="' . JText::_('JGLOBAL_TYPE_OR_SELECT_CATEGORY') . '" '; + + if ($this->customPrefix !== '') + { + $attr .= 'data-custom_value_prefix="' . $this->customPrefix . '" '; + } } if ($class) diff --git a/administrator/components/com_categories/views/categories/tmpl/default_batch_footer.php b/administrator/components/com_categories/views/categories/tmpl/default_batch_footer.php index dbf75be88da6b..a4c53bf197982 100644 --- a/administrator/components/com_categories/views/categories/tmpl/default_batch_footer.php +++ b/administrator/components/com_categories/views/categories/tmpl/default_batch_footer.php @@ -12,6 +12,6 @@ - diff --git a/administrator/components/com_categories/views/category/tmpl/edit.php b/administrator/components/com_categories/views/category/tmpl/edit.php index 1c2b9b2ee5c49..4bea688a7b370 100644 --- a/administrator/components/com_categories/views/category/tmpl/edit.php +++ b/administrator/components/com_categories/views/category/tmpl/edit.php @@ -14,6 +14,7 @@ JHtml::_('behavior.formvalidator'); JHtml::_('behavior.keepalive'); +JHtml::_('formbehavior.chosen', '#jform_tags', null, array('placeholder_text_multiple' => JText::_('JGLOBAL_TYPE_OR_SELECT_SOME_TAGS'))); JHtml::_('formbehavior.chosen', 'select'); $app = JFactory::getApplication(); diff --git a/administrator/components/com_config/controller/component/save.php b/administrator/components/com_config/controller/component/save.php index 05271f18d8cb3..8c773c0fb02e2 100644 --- a/administrator/components/com_config/controller/component/save.php +++ b/administrator/components/com_config/controller/component/save.php @@ -50,6 +50,15 @@ public function execute() $option = $this->input->get('component'); $user = JFactory::getUser(); + // Make sure com_joomlaupdate and com_privacy can only be accessed by SuperUser + if (in_array(strtolower($option), array('com_joomlaupdate', 'com_privacy')) + && !JFactory::getUser()->authorise('core.admin')) + { + $this->app->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'), 'error'); + + return; + } + // Check if the user is authorised to do this. if (!$user->authorise('core.admin', $option) && !$user->authorise('core.options', $option)) { diff --git a/administrator/components/com_config/model/application.php b/administrator/components/com_config/model/application.php index 1950c58e69965..13eee11ffd628 100644 --- a/administrator/components/com_config/model/application.php +++ b/administrator/components/com_config/model/application.php @@ -59,6 +59,9 @@ public function getData() $config = new JConfig; $data = ArrayHelper::fromObject($config); + // Get the correct driver at runtime + $data['dbtype'] = JFactory::getDbo()->getName(); + // Prime the asset_id for the rules. $data['asset_id'] = 1; diff --git a/administrator/components/com_config/model/form/application.xml b/administrator/components/com_config/model/form/application.xml index e570c2ed26dc7..0296bf0166907 100644 --- a/administrator/components/com_config/model/form/application.xml +++ b/administrator/components/com_config/model/form/application.xml @@ -1194,15 +1194,6 @@ size="50" /> - -
id)) + if (empty($record->id) || $record->published != -2) { - if ($record->published != -2) - { - return false; - } - - return JFactory::getUser()->authorise('core.delete', 'com_contact.category.' . (int) $record->catid); + return false; } + + return JFactory::getUser()->authorise('core.delete', 'com_contact.category.' . (int) $record->catid); } /** @@ -291,20 +288,22 @@ public function save($data) JLoader::register('CategoriesHelper', JPATH_ADMINISTRATOR . '/components/com_categories/helpers/categories.php'); - // Cast catid to integer for comparison - $catid = (int) $data['catid']; + // Create new category, if needed. + $createCategory = true; - // Check if New Category exists - if ($catid > 0) + // If category ID is provided, check if it's valid. + if (is_numeric($data['catid']) && $data['catid']) { - $catid = CategoriesHelper::validateCategoryId($data['catid'], 'com_contact'); + $createCategory = !CategoriesHelper::validateCategoryId($data['catid'], 'com_contact'); } // Save New Category - if ($catid == 0 && $this->canCreateCategory()) + if ($createCategory && $this->canCreateCategory()) { $table = array(); - $table['title'] = $data['catid']; + + // Remove #new# prefix, if exists. + $table['title'] = strpos($data['catid'], '#new#') === 0 ? substr($data['catid'], 5) : $data['catid']; $table['parent_id'] = 1; $table['extension'] = 'com_contact'; $table['language'] = $data['language']; @@ -438,6 +437,9 @@ protected function preprocessForm(JForm $form, $data, $group = 'content') if ($this->canCreateCategory()) { $form->setFieldAttribute('catid', 'allowAdd', 'true'); + + // Add a prefix for categories created on the fly. + $form->setFieldAttribute('catid', 'customPrefix', '#new#'); } // Association contact items @@ -526,35 +528,6 @@ public function featured($pks, $value = 0) return true; } - /** - * Method to change the title & alias. - * - * @param integer $category_id The id of the parent. - * @param string $alias The alias. - * @param string $name The title. - * - * @return array Contains the modified title and alias. - * - * @since 3.1 - */ - protected function generateNewTitle($category_id, $alias, $name) - { - // Alter the title & alias - $table = $this->getTable(); - - while ($table->load(array('alias' => $alias, 'catid' => $category_id))) - { - if ($name == $table->name) - { - $name = StringHelper::increment($name); - } - - $alias = StringHelper::increment($alias, 'dash'); - } - - return array($name, $alias); - } - /** * Is the user allowed to create an on the fly category? * diff --git a/administrator/components/com_contact/tables/contact.php b/administrator/components/com_contact/tables/contact.php index af11346448e3a..911a871e49379 100644 --- a/administrator/components/com_contact/tables/contact.php +++ b/administrator/components/com_contact/tables/contact.php @@ -38,6 +38,8 @@ public function __construct(&$db) { parent::__construct('#__contact_details', 'id', $db); + $this->setColumnAlias('title', 'name'); + JTableObserverTags::createObserver($this, array('typeAlias' => 'com_contact.contact')); JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_contact.contact')); } diff --git a/administrator/components/com_contact/views/contact/tmpl/edit.php b/administrator/components/com_contact/views/contact/tmpl/edit.php index 05527fcb3f205..3458a4c875dd8 100644 --- a/administrator/components/com_contact/views/contact/tmpl/edit.php +++ b/administrator/components/com_contact/views/contact/tmpl/edit.php @@ -15,6 +15,7 @@ JHtml::_('behavior.formvalidator'); JHtml::_('behavior.keepalive'); JHtml::_('formbehavior.chosen', '#jform_catid', null, array('disable_search_threshold' => 0 )); +JHtml::_('formbehavior.chosen', '#jform_tags', null, array('placeholder_text_multiple' => JText::_('JGLOBAL_TYPE_OR_SELECT_SOME_TAGS'))); JHtml::_('formbehavior.chosen', 'select'); $app = JFactory::getApplication(); diff --git a/administrator/components/com_contact/views/contacts/tmpl/default.php b/administrator/components/com_contact/views/contacts/tmpl/default.php index 2011690e1e57c..5ea5f005a4659 100644 --- a/administrator/components/com_contact/views/contacts/tmpl/default.php +++ b/administrator/components/com_contact/views/contacts/tmpl/default.php @@ -135,8 +135,8 @@ ?> - -
+ +
checked_out) : ?> editor, $item->checked_out_time, 'contacts.', $canCheckin); ?> diff --git a/administrator/components/com_contact/views/contacts/tmpl/default_batch.php b/administrator/components/com_contact/views/contacts/tmpl/default_batch.php index c0708d9a924db..c2ae49aabf7a2 100644 --- a/administrator/components/com_contact/views/contacts/tmpl/default_batch.php +++ b/administrator/components/com_contact/views/contacts/tmpl/default_batch.php @@ -57,7 +57,7 @@ -
diff --git a/administrator/components/com_contact/views/contacts/tmpl/default_batch_footer.php b/administrator/components/com_contact/views/contacts/tmpl/default_batch_footer.php index da0dfc05208ce..f5b937d755691 100644 --- a/administrator/components/com_contact/views/contacts/tmpl/default_batch_footer.php +++ b/administrator/components/com_contact/views/contacts/tmpl/default_batch_footer.php @@ -12,6 +12,6 @@ - diff --git a/administrator/components/com_contact/views/contacts/tmpl/modal.php b/administrator/components/com_contact/views/contacts/tmpl/modal.php index 42058a82c3bae..54bc5ce762f46 100644 --- a/administrator/components/com_contact/views/contacts/tmpl/modal.php +++ b/administrator/components/com_contact/views/contacts/tmpl/modal.php @@ -46,7 +46,7 @@ ?>
-
+ $this)); ?> @@ -123,7 +123,7 @@ escape($item->name); ?> - escape($item->name); ?> + escape($item->name); ?>
escape($item->category_title); ?>
diff --git a/administrator/components/com_content/models/article.php b/administrator/components/com_content/models/article.php index 6e4c814b92343..78b5e746e9f17 100644 --- a/administrator/components/com_content/models/article.php +++ b/administrator/components/com_content/models/article.php @@ -213,17 +213,12 @@ protected function batchMove($value, $pks, $contexts) */ protected function canDelete($record) { - if (!empty($record->id)) + if (empty($record->id) || $record->state != -2) { - if ($record->state != -2) - { - return false; - } - - return JFactory::getUser()->authorise('core.delete', 'com_content.article.' . (int) $record->id); + return false; } - return false; + return JFactory::getUser()->authorise('core.delete', 'com_content.article.' . (int) $record->id); } /** @@ -370,6 +365,9 @@ public function getItem($pk = null) */ public function getForm($data = array(), $loadData = true) { + $app = JFactory::getApplication(); + $user = JFactory::getUser(); + // Get the form. $form = $this->loadForm('com_content.article', 'article', array('control' => 'jform', 'load_data' => $loadData)); @@ -395,7 +393,20 @@ public function getForm($data = array(), $loadData = true) $form->setFieldAttribute('catid', 'action', 'core.edit'); // Existing record. Can only edit own articles in selected categories. - $form->setFieldAttribute('catid', 'action', 'core.edit.own'); + if ($app->isClient('administrator')) + { + $form->setFieldAttribute('catid', 'action', 'core.edit.own'); + } + else + // Existing record. We can't edit the category in frontend if not edit.state. + { + if ($id != 0 && (!$user->authorise('core.edit.state', 'com_content.article.' . (int) $id)) + || ($id == 0 && !$user->authorise('core.edit.state', 'com_content'))) + { + $form->setFieldAttribute('catid', 'readonly', 'true'); + $form->setFieldAttribute('catid', 'filter', 'unset'); + } + } } else { @@ -403,8 +414,6 @@ public function getForm($data = array(), $loadData = true) $form->setFieldAttribute('catid', 'action', 'core.create'); } - $user = JFactory::getUser(); - // Check for existing article. // Modify the form based on Edit State access controls. if ($id != 0 && (!$user->authorise('core.edit.state', 'com_content.article.' . (int) $id)) @@ -427,7 +436,6 @@ public function getForm($data = array(), $loadData = true) } // Prevent messing with article language and category when editing existing article with associations - $app = JFactory::getApplication(); $assoc = JLanguageAssociations::isEnabled(); // Check if article is associated @@ -560,20 +568,22 @@ public function save($data) JLoader::register('CategoriesHelper', JPATH_ADMINISTRATOR . '/components/com_categories/helpers/categories.php'); - // Cast catid to integer for comparison - $catid = (int) $data['catid']; + // Create new category, if needed. + $createCategory = true; - // Check if New Category exists - if ($catid > 0) + // If category ID is provided, check if it's valid. + if (is_numeric($data['catid']) && $data['catid']) { - $catid = CategoriesHelper::validateCategoryId($data['catid'], 'com_content'); + $createCategory = !CategoriesHelper::validateCategoryId($data['catid'], 'com_content'); } // Save New Category - if ($catid == 0 && $this->canCreateCategory()) + if ($createCategory && $this->canCreateCategory()) { $table = array(); - $table['title'] = $data['catid']; + + // Remove #new# prefix, if exists. + $table['title'] = strpos($data['catid'], '#new#') === 0 ? substr($data['catid'], 5) : $data['catid']; $table['parent_id'] = 1; $table['extension'] = 'com_content'; $table['language'] = $data['language']; @@ -797,6 +807,9 @@ protected function preprocessForm(JForm $form, $data, $group = 'content') if ($this->canCreateCategory()) { $form->setFieldAttribute('catid', 'allowAdd', 'true'); + + // Add a prefix for categories created on the fly. + $form->setFieldAttribute('catid', 'customPrefix', '#new#'); } // Association content items diff --git a/administrator/components/com_content/models/articles.php b/administrator/components/com_content/models/articles.php index 33ecc606626c6..108bb65c19200 100644 --- a/administrator/components/com_content/models/articles.php +++ b/administrator/components/com_content/models/articles.php @@ -388,6 +388,11 @@ protected function getListQuery() $orderCol = $this->state->get('list.ordering', 'a.id'); $orderDirn = $this->state->get('list.direction', 'DESC'); + if ($orderCol == 'a.ordering' || $orderCol == 'category_title') + { + $orderCol = $db->quoteName('c.title') . ' ' . $orderDirn . ', ' . $db->quoteName('a.ordering'); + } + $query->order($db->escape($orderCol) . ' ' . $db->escape($orderDirn)); return $query; diff --git a/administrator/components/com_content/views/article/tmpl/edit.php b/administrator/components/com_content/views/article/tmpl/edit.php index 7b32d5027a8cf..8d4f0d4b7bcde 100644 --- a/administrator/components/com_content/views/article/tmpl/edit.php +++ b/administrator/components/com_content/views/article/tmpl/edit.php @@ -17,6 +17,7 @@ JHtml::_('behavior.formvalidator'); JHtml::_('behavior.keepalive'); JHtml::_('formbehavior.chosen', '#jform_catid', null, array('disable_search_threshold' => 0 )); +JHtml::_('formbehavior.chosen', '#jform_tags', null, array('placeholder_text_multiple' => JText::_('JGLOBAL_TYPE_OR_SELECT_SOME_TAGS'))); JHtml::_('formbehavior.chosen', 'select'); $this->configFieldsets = array('editorConfig'); diff --git a/administrator/components/com_content/views/articles/tmpl/default_batch_footer.php b/administrator/components/com_content/views/articles/tmpl/default_batch_footer.php index d44481e81d5e3..10b7c1b164d55 100644 --- a/administrator/components/com_content/views/articles/tmpl/default_batch_footer.php +++ b/administrator/components/com_content/views/articles/tmpl/default_batch_footer.php @@ -12,6 +12,6 @@ - diff --git a/administrator/components/com_contenthistory/models/history.php b/administrator/components/com_contenthistory/models/history.php index 7434a8cc22b41..91a8e6f8e1cf8 100644 --- a/administrator/components/com_contenthistory/models/history.php +++ b/administrator/components/com_contenthistory/models/history.php @@ -98,7 +98,7 @@ protected function canEdit($record) */ protected function canDelete($record) { - return canEdit($record); + return $this->canEdit($record); } /** diff --git a/administrator/components/com_fields/models/field.php b/administrator/components/com_fields/models/field.php index 99eed11d1023b..2bfba7cf6cbc3 100644 --- a/administrator/components/com_fields/models/field.php +++ b/administrator/components/com_fields/models/field.php @@ -343,34 +343,6 @@ public function getItem($pk = null) $db->setQuery($query); $result->assigned_cat_ids = $db->loadColumn() ?: array(0); - - // Convert the created and modified dates to local user time for - // display in the form. - $tz = new DateTimeZone(JFactory::getApplication()->get('offset')); - - if ((int) $result->created_time) - { - $date = new JDate($result->created_time); - $date->setTimezone($tz); - - $result->created_time = $date->toSql(true); - } - else - { - $result->created_time = null; - } - - if ((int) $result->modified_time) - { - $date = new JDate($result->modified_time); - $date->setTimezone($tz); - - $result->modified_time = $date->toSql(true); - } - else - { - $result->modified_time = null; - } } return $result; @@ -772,19 +744,14 @@ public function cleanupValues($context, $itemId) */ protected function canDelete($record) { - if (!empty($record->id)) + if (empty($record->id) || $record->state != -2) { - if ($record->state != -2) - { - return false; - } - - $parts = FieldsHelper::extract($record->context); - - return JFactory::getUser()->authorise('core.delete', $parts[0] . '.field.' . (int) $record->id); + return false; } - return false; + $parts = FieldsHelper::extract($record->context); + + return JFactory::getUser()->authorise('core.delete', $parts[0] . '.field.' . (int) $record->id); } /** diff --git a/administrator/components/com_fields/models/fields.php b/administrator/components/com_fields/models/fields.php index 0cfab21ca1ab1..771997d3a7191 100644 --- a/administrator/components/com_fields/models/fields.php +++ b/administrator/components/com_fields/models/fields.php @@ -44,7 +44,7 @@ public function __construct($config = array()) 'checked_out_time', 'a.checked_out_time', 'created_time', 'a.created_time', 'created_user_id', 'a.created_user_id', - 'category_title', + 'group_title', 'g.title', 'category_id', 'a.category_id', 'group_id', 'a.group_id', 'assigned_cat_ids' @@ -133,7 +133,7 @@ protected function getListQuery() $query->select( $this->getState( 'list.select', - 'a.id, a.title, a.name, a.checked_out, a.checked_out_time, a.note' . + 'DISTINCT a.id, a.title, a.name, a.checked_out, a.checked_out_time, a.note' . ', a.state, a.access, a.created_time, a.created_user_id, a.ordering, a.language' . ', a.fieldparams, a.params, a.type, a.default_value, a.context, a.group_id' . ', a.label, a.description, a.required' diff --git a/administrator/components/com_fields/models/forms/field.xml b/administrator/components/com_fields/models/forms/field.xml index 5b508f9312a91..bdb36bda01b7c 100644 --- a/administrator/components/com_fields/models/forms/field.xml +++ b/administrator/components/com_fields/models/forms/field.xml @@ -264,14 +264,14 @@ - - - + + + addTablePath(JPATH_ADMINISTRATOR . '/components/com_fields/tables'); - } + $this->addTablePath(JPATH_ADMINISTRATOR . '/components/com_fields/tables'); return JTable::getInstance($name, $prefix, $options); } @@ -325,31 +322,6 @@ public function getItem($pk = null) { $item->params = new Registry($item->params); } - - // Convert the created and modified dates to local user time for display in the form. - $tz = new DateTimeZone(JFactory::getApplication()->get('offset')); - - if ((int) $item->created) - { - $date = new JDate($item->created); - $date->setTimezone($tz); - $item->created = $date->toSql(true); - } - else - { - $item->created = null; - } - - if ((int) $item->modified) - { - $date = new JDate($item->modified); - $date->setTimezone($tz); - $item->modified = $date->toSql(true); - } - else - { - $item->modified = null; - } } return $item; diff --git a/administrator/components/com_fields/views/fields/tmpl/default_batch_footer.php b/administrator/components/com_fields/views/fields/tmpl/default_batch_footer.php index 7cfcfeeb00295..c4a677de532c6 100644 --- a/administrator/components/com_fields/views/fields/tmpl/default_batch_footer.php +++ b/administrator/components/com_fields/views/fields/tmpl/default_batch_footer.php @@ -12,6 +12,6 @@ - diff --git a/administrator/components/com_fields/views/fields/tmpl/modal.php b/administrator/components/com_fields/views/fields/tmpl/modal.php index 9817ecd08d8ea..9f8cb3a4f8532 100644 --- a/administrator/components/com_fields/views/fields/tmpl/modal.php +++ b/administrator/components/com_fields/views/fields/tmpl/modal.php @@ -30,7 +30,7 @@ ?>
- + $this)); ?> items)) : ?> @@ -48,7 +48,7 @@ - + @@ -57,7 +57,7 @@ - + diff --git a/administrator/components/com_fields/views/fields/view.html.php b/administrator/components/com_fields/views/fields/view.html.php index 285b8e4462d6e..261abe9ddb6d2 100644 --- a/administrator/components/com_fields/views/fields/view.html.php +++ b/administrator/components/com_fields/views/fields/view.html.php @@ -92,11 +92,10 @@ public function display($tpl = null) if ($this->getLayout() !== 'modal') { $this->addToolbar(); + FieldsHelper::addSubmenu($this->state->get('filter.context'), 'fields'); + $this->sidebar = JHtmlSidebar::render(); } - FieldsHelper::addSubmenu($this->state->get('filter.context'), 'fields'); - $this->sidebar = JHtmlSidebar::render(); - return parent::display($tpl); } @@ -204,7 +203,7 @@ protected function getSortFields() 'a.title' => JText::_('JGLOBAL_TITLE'), 'a.type' => JText::_('COM_FIELDS_FIELD_TYPE_LABEL'), 'a.access' => JText::_('JGRID_HEADING_ACCESS'), - 'language' => JText::_('JGRID_HEADING_LANGUAGE'), + 'a.language' => JText::_('JGRID_HEADING_LANGUAGE'), 'a.id' => JText::_('JGRID_HEADING_ID'), ); } diff --git a/administrator/components/com_fields/views/groups/tmpl/default_batch_footer.php b/administrator/components/com_fields/views/groups/tmpl/default_batch_footer.php index ea87f989c016b..3874e18f65f16 100644 --- a/administrator/components/com_fields/views/groups/tmpl/default_batch_footer.php +++ b/administrator/components/com_fields/views/groups/tmpl/default_batch_footer.php @@ -12,6 +12,6 @@ - diff --git a/administrator/components/com_finder/helpers/indexer/parser/html.php b/administrator/components/com_finder/helpers/indexer/parser/html.php index 4db9a8f1264ae..cad13a58a8405 100644 --- a/administrator/components/com_finder/helpers/indexer/parser/html.php +++ b/administrator/components/com_finder/helpers/indexer/parser/html.php @@ -60,9 +60,14 @@ public function parse($input) // Convert entities equivalent to spaces to actual spaces. $input = str_replace(array(' ', ' '), ' ', $input); - // This fixes issues such as '

Title

Paragraph

' - // being transformed into 'TitleParagraph' with no space. - $input = str_replace('>', '> ', $input); + // Add a space before both the OPEN and CLOSE tags of BLOCK and LINE BREAKING elements, + // e.g. 'all

mobile List

' will become 'all mobile List' + $input = preg_replace('/(<|<\/)(' . + 'address|article|aside|blockquote|br|canvas|dd|div|dl|dt|' . + 'fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|li|' . + 'main|nav|noscript|ol|output|p|pre|section|table|tfoot|ul|video' . + ')\b/i', ' $1$2', $input + ); // Strip HTML tags. $input = strip_tags($input); diff --git a/administrator/components/com_finder/models/maps.php b/administrator/components/com_finder/models/maps.php index 7007d22b47a26..2b02c89b48cf2 100644 --- a/administrator/components/com_finder/models/maps.php +++ b/administrator/components/com_finder/models/maps.php @@ -398,8 +398,7 @@ public function purge() $db->execute(); $query->clear() - ->delete($db->quoteName('#__finder_taxonomy_map')) - ->where('1'); + ->delete($db->quoteName('#__finder_taxonomy_map')); $db->setQuery($query); $db->execute(); diff --git a/administrator/components/com_installer/models/extension.php b/administrator/components/com_installer/models/extension.php index 474f9f67772ed..2595a94b25a70 100644 --- a/administrator/components/com_installer/models/extension.php +++ b/administrator/components/com_installer/models/extension.php @@ -117,10 +117,10 @@ protected function _getList($query, $limitstart = 0, $limit = 0) $total = count($result); $this->cache[$this->getStoreId('getTotal')] = $total; - if ($total < $limitstart) + if ($total <= $limitstart) { $limitstart = 0; - $this->setState('list.start', 0); + $this->setState('list.limitstart', 0); } return array_slice($result, $limitstart, $limit ?: null); diff --git a/administrator/components/com_installer/models/update.php b/administrator/components/com_installer/models/update.php index 6878a52c2d17d..67c1916a4d306 100644 --- a/administrator/components/com_installer/models/update.php +++ b/administrator/components/com_installer/models/update.php @@ -255,9 +255,6 @@ public function getDisabledUpdateSites() */ public function findUpdates($eid = 0, $cache_timeout = 0, $minimum_stability = JUpdater::STABILITY_STABLE) { - // Purge the updates list - $this->purge(); - JUpdater::getInstance()->findUpdates($eid, $cache_timeout, $minimum_stability); return true; diff --git a/administrator/components/com_joomlaupdate/access.xml b/administrator/components/com_joomlaupdate/access.xml deleted file mode 100644 index c8c9f3dd739df..0000000000000 --- a/administrator/components/com_joomlaupdate/access.xml +++ /dev/null @@ -1,10 +0,0 @@ - - -
- - - - - -
-
diff --git a/administrator/components/com_joomlaupdate/config.xml b/administrator/components/com_joomlaupdate/config.xml index 0253763b333d3..d4b814bcba382 100644 --- a/administrator/components/com_joomlaupdate/config.xml +++ b/administrator/components/com_joomlaupdate/config.xml @@ -22,6 +22,21 @@ + + + + + + + +
- -
- - - -
diff --git a/administrator/components/com_joomlaupdate/joomlaupdate.php b/administrator/components/com_joomlaupdate/joomlaupdate.php index b9da5340a408d..b31da112280a6 100644 --- a/administrator/components/com_joomlaupdate/joomlaupdate.php +++ b/administrator/components/com_joomlaupdate/joomlaupdate.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -if (!JFactory::getUser()->authorise('core.admin', 'com_joomlaupdate')) +if (!JFactory::getUser()->authorise('core.admin')) { throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403); } diff --git a/administrator/components/com_joomlaupdate/models/default.php b/administrator/components/com_joomlaupdate/models/default.php index ba224117d5ff7..7729824a22091 100644 --- a/administrator/components/com_joomlaupdate/models/default.php +++ b/administrator/components/com_joomlaupdate/models/default.php @@ -114,12 +114,17 @@ public function refreshUpdates($force = false) } else { - $update_params = JComponentHelper::getParams('com_installer'); - $cache_timeout = $update_params->get('cachetimeout', 6, 'int'); - $cache_timeout = 3600 * $cache_timeout; + $cache_timeout = 3600 * JComponentHelper::getParams('com_installer')->get('cachetimeout', 6, 'int'); } - $updater = JUpdater::getInstance(); + $updater = JUpdater::getInstance(); + $minimumStability = JUpdater::STABILITY_STABLE; + $comJoomlaupdateParams = JComponentHelper::getParams('com_joomlaupdate'); + + if (in_array($comJoomlaupdateParams->get('updatesource', 'nochange'), array('testing', 'custom'))) + { + $minimumStability = $comJoomlaupdateParams->get('minimum_stability', JUpdater::STABILITY_STABLE); + } $reflection = new ReflectionObject($updater); $reflectionMethod = $reflection->getMethod('findUpdates'); @@ -128,11 +133,11 @@ public function refreshUpdates($force = false) if (count($methodParameters) >= 4) { // Reinstall support is available in JUpdater - $updater->findUpdates(700, $cache_timeout, JUpdater::STABILITY_STABLE, true); + $updater->findUpdates(700, $cache_timeout, $minimumStability, true); } else { - $updater->findUpdates(700, $cache_timeout, JUpdater::STABILITY_STABLE); + $updater->findUpdates(700, $cache_timeout, $minimumStability); } } @@ -164,18 +169,41 @@ public function getUpdateInformation() if (is_null($updateObject)) { + // We have not found any update in the database we seem to run the latest version + $ret['latest'] = JVERSION; + + return $ret; + } + + // Check whether this is a valid update or not + if (version_compare($updateObject->version, JVERSION, '<')) + { + // This update points to an outdated version we should not offer to update to this $ret['latest'] = JVERSION; return $ret; } - $ret['latest'] = $updateObject->version; - $ret['hasUpdate'] = $updateObject->version != JVERSION; + $ret['latest'] = $updateObject->version; + + // Check whether this is an update or not. + if (version_compare($updateObject->version, JVERSION, '>')) + { + $ret['hasUpdate'] = true; + } + + $minimumStability = JUpdater::STABILITY_STABLE; + $comJoomlaupdateParams = JComponentHelper::getParams('com_joomlaupdate'); + + if (in_array($comJoomlaupdateParams->get('updatesource', 'nochange'), array('testing', 'custom'))) + { + $minimumStability = $comJoomlaupdateParams->get('minimum_stability', JUpdater::STABILITY_STABLE); + } // Fetch the full update details from the update details URL. jimport('joomla.updater.update'); $update = new JUpdate; - $update->loadFromXML($updateObject->detailsurl); + $update->loadFromXML($updateObject->detailsurl, $minimumStability); $ret['object'] = $update; @@ -214,16 +242,18 @@ public function purge() { $db = $this->getDbo(); - // Modify the database record - $update_site = new stdClass; - $update_site->last_check_timestamp = 0; - $update_site->enabled = 1; - $update_site->update_site_id = 1; - $db->updateObject('#__update_sites', $update_site, 'update_site_id'); + // Reset the last update check timestamp + $query = $db->getQuery(true) + ->update($db->quoteName('#__update_sites')) + ->set($db->quoteName('last_check_timestamp') . ' = 0'); + $db->setQuery($query); + $db->execute(); + // We should delete all core updates here $query = $db->getQuery(true) ->delete($db->quoteName('#__updates')) - ->where($db->quoteName('update_site_id') . ' = ' . $db->quote('1')); + ->where($db->quoteName('element') . ' = ' . $db->quote('joomla')) + ->where($db->quoteName('type') . ' = ' . $db->quote('file')); $db->setQuery($query); if ($db->execute()) @@ -327,7 +357,7 @@ public function download() * @param JUpdate $updateObject The Update Object * * @return boolean False in case the validation did not work; true in any other case. - * + * * @note This method has been forked from (JInstallerHelper::isChecksumValid) so it * does not depend on an up-to-date InstallerHelper at the update time * @@ -998,7 +1028,7 @@ public function captiveLogin($credentials) return false; } - // Make sure the user we're authorising is a Super User + // Make sure the user is authorised if (!$user->authorise('core.admin')) { return false; diff --git a/administrator/components/com_joomlaupdate/views/default/tmpl/default.php b/administrator/components/com_joomlaupdate/views/default/tmpl/default.php index f8c6d8d8791f7..1527dd250949d 100644 --- a/administrator/components/com_joomlaupdate/views/default/tmpl/default.php +++ b/administrator/components/com_joomlaupdate/views/default/tmpl/default.php @@ -45,11 +45,14 @@ enqueueMessage(JText::_('COM_JOOMLAUPDATE_VIEW_DEFAULT_INSTALL_SELF_UPDATE_FIRST'), 'error'); ?> loadTemplate('updatemefirst'); ?> - updateInfo['object']->downloadurl->_data) && $this->updateInfo['installed'] < $this->updateInfo['latest']) : ?> + updateInfo['object']->downloadurl->_data) && !$this->updateInfo['hasUpdate']) : ?> + + loadTemplate('noupdate'); ?> + updateInfo['object']->downloadurl->_data)) : ?> loadTemplate('nodownload'); ?> updateInfo['hasUpdate']) : ?> - + loadTemplate('reinstall'); ?> diff --git a/administrator/components/com_joomlaupdate/views/default/tmpl/default_noupdate.php b/administrator/components/com_joomlaupdate/views/default/tmpl/default_noupdate.php new file mode 100644 index 0000000000000..749f4f28ab072 --- /dev/null +++ b/administrator/components/com_joomlaupdate/views/default/tmpl/default_noupdate.php @@ -0,0 +1,24 @@ + +
+ + + +

+ langKey, $this->updateSourceKey); ?> +

+
+ +
+
diff --git a/administrator/components/com_joomlaupdate/views/default/tmpl/default_reinstall.php b/administrator/components/com_joomlaupdate/views/default/tmpl/default_reinstall.php index 144dbdf941979..62722588399f9 100644 --- a/administrator/components/com_joomlaupdate/views/default/tmpl/default_reinstall.php +++ b/administrator/components/com_joomlaupdate/views/default/tmpl/default_reinstall.php @@ -31,8 +31,10 @@ - + updateInfo['object']->downloadurl->_data; ?> + + @@ -43,8 +45,10 @@ - + updateInfo['object']->get('infourl')->title; ?> + + diff --git a/administrator/components/com_joomlaupdate/views/default/tmpl/default_update.php b/administrator/components/com_joomlaupdate/views/default/tmpl/default_update.php index d754da9ba40c9..e066f9013cae1 100644 --- a/administrator/components/com_joomlaupdate/views/default/tmpl/default_update.php +++ b/administrator/components/com_joomlaupdate/views/default/tmpl/default_update.php @@ -26,7 +26,7 @@ - updateInfo['installed']; ?> + updateInfo['installed']; ?> @@ -34,7 +34,7 @@ - updateInfo['latest']; ?> + updateInfo['latest']; ?> @@ -42,8 +42,10 @@ - + updateInfo['object']->downloadurl->_data; ?> + + @@ -54,8 +56,10 @@ - + updateInfo['object']->get('infourl')->title; ?> + + 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 bb11d9cab962b..608856cd37935 100644 --- a/administrator/components/com_joomlaupdate/views/default/tmpl/default_upload.php +++ b/administrator/components/com_joomlaupdate/views/default/tmpl/default_upload.php @@ -98,7 +98,7 @@
- + diff --git a/administrator/components/com_joomlaupdate/views/default/view.html.php b/administrator/components/com_joomlaupdate/views/default/view.html.php index 71c518fa3bb1b..9fd3c65c29c52 100644 --- a/administrator/components/com_joomlaupdate/views/default/view.html.php +++ b/administrator/components/com_joomlaupdate/views/default/view.html.php @@ -75,9 +75,7 @@ public function display($tpl = null) JToolbarHelper::custom('update.purge', 'loop', 'loop', 'COM_JOOMLAUPDATE_TOOLBAR_CHECK', false); // Add toolbar buttons. - $user = JFactory::getUser(); - - if ($user->authorise('core.admin', 'com_joomlaupdate') || $user->authorise('core.options', 'com_joomlaupdate')) + if (JFactory::getUser()->authorise('core.admin')) { JToolbarHelper::preferences('com_joomlaupdate'); } diff --git a/administrator/components/com_languages/views/multilangstatus/tmpl/default.php b/administrator/components/com_languages/views/multilangstatus/tmpl/default.php index b5145215b53a4..42e1e62cbafe9 100644 --- a/administrator/components/com_languages/views/multilangstatus/tmpl/default.php +++ b/administrator/components/com_languages/views/multilangstatus/tmpl/default.php @@ -96,9 +96,9 @@ listUsersError) : ?> - + - + diff --git a/administrator/components/com_media/controllers/file.json.php b/administrator/components/com_media/controllers/file.json.php index 20149e53a4cf9..0bf77ec08dcd4 100644 --- a/administrator/components/com_media/controllers/file.json.php +++ b/administrator/components/com_media/controllers/file.json.php @@ -93,7 +93,8 @@ public function upload() $filepath = JPath::clean($files['final']); - if (!$mediaHelper->canUpload($file, 'com_media')) + if (!$mediaHelper->canUpload($file, 'com_media') + || strpos(realpath($fileparts['dirname']), JPath::clean(realpath(COM_MEDIA_BASE))) !== 0) { try { diff --git a/administrator/components/com_media/controllers/file.php b/administrator/components/com_media/controllers/file.php index e8dc639a1c90b..754ff91cdcb6a 100644 --- a/administrator/components/com_media/controllers/file.php +++ b/administrator/components/com_media/controllers/file.php @@ -114,6 +114,13 @@ public function upload() // We need a url safe name $fileparts = pathinfo(COM_MEDIA_BASE . '/' . $this->folder . '/' . $file['name']); + if (strpos(realpath($fileparts['dirname']), JPath::clean(realpath(COM_MEDIA_BASE))) !== 0) + { + JError::raiseWarning(100, JText::_('COM_MEDIA_ERROR_WARNINVALID_FOLDER')); + + return false; + } + // Transform filename to punycode, check extension and transform it to lowercase $fileparts['filename'] = JStringPunycode::toPunycode($fileparts['filename']); $tempExt = !empty($fileparts['extension']) ? strtolower($fileparts['extension']) : ''; @@ -274,6 +281,17 @@ public function delete() $ret = true; $safePaths = array_intersect($paths, array_map(array('JFile', 'makeSafe'), $paths)); + + foreach ($safePaths as $key => $path) + { + $fullPath = implode(DIRECTORY_SEPARATOR, array(COM_MEDIA_BASE, $folder, $path)); + + if (strpos(realpath($fullPath), JPath::clean(realpath(COM_MEDIA_BASE))) !== 0) + { + unset($safePaths[$key]); + } + } + $unsafePaths = array_diff($paths, $safePaths); foreach ($unsafePaths as $path) diff --git a/administrator/components/com_media/controllers/folder.php b/administrator/components/com_media/controllers/folder.php index 79ebfc94764d2..9064ea341752f 100644 --- a/administrator/components/com_media/controllers/folder.php +++ b/administrator/components/com_media/controllers/folder.php @@ -87,6 +87,14 @@ public function delete() foreach ($safePaths as $path) { $fullPath = JPath::clean(implode(DIRECTORY_SEPARATOR, array(COM_MEDIA_BASE, $folder, $path))); + + if (strpos(realpath($fullPath), JPath::clean(realpath(COM_MEDIA_BASE))) !== 0) + { + JError::raiseWarning(100, JText::_('COM_MEDIA_ERROR_WARNINVALID_FOLDER')); + + continue; + } + $object_file = new JObject(array('filepath' => $fullPath)); if (is_file($object_file->filepath)) @@ -190,6 +198,14 @@ public function create() $path = JPath::clean(COM_MEDIA_BASE . '/' . $parent . '/' . $folder); + if (strpos(realpath(COM_MEDIA_BASE . '/' . $parent), JPath::clean(realpath(COM_MEDIA_BASE))) !== 0) + { + $app = JFactory::getApplication(); + $app->enqueueMessage(JText::_('COM_MEDIA_ERROR_WARNINVALID_FOLDER'), 'error'); + + return false; + } + if (!is_dir($path) && !is_file($path)) { // Trigger the onContentBeforeSave event. diff --git a/administrator/components/com_media/models/list.php b/administrator/components/com_media/models/list.php index b3a670553eee0..f0def2679b353 100644 --- a/administrator/components/com_media/models/list.php +++ b/administrator/components/com_media/models/list.php @@ -113,6 +113,12 @@ public function getList() $basePath = COM_MEDIA_BASE . ((strlen($current) > 0) ? '/' . $current : ''); $mediaBase = str_replace(DIRECTORY_SEPARATOR, '/', COM_MEDIA_BASE . '/'); + // Reset base path + if (strpos(realpath($basePath), JPath::clean(realpath(COM_MEDIA_BASE))) !== 0) + { + $basePath = COM_MEDIA_BASE; + } + $images = array (); $folders = array (); $docs = array (); diff --git a/administrator/components/com_media/views/images/tmpl/default.php b/administrator/components/com_media/views/images/tmpl/default.php index 043bb34a6b98a..87f05fe4832db 100644 --- a/administrator/components/com_media/views/images/tmpl/default.php +++ b/administrator/components/com_media/views/images/tmpl/default.php @@ -65,28 +65,30 @@ ?>
- +
-
-
+
+
- +
folderList; ?>
-
- - +
+
+ + +
@@ -95,7 +97,7 @@
-
+
@@ -103,7 +105,12 @@
- state->get('field.id')) : ?> +
+
+ + state->get('field.id')) : ?> +
+
@@ -117,9 +124,7 @@
- -
- state->get('field.id')) : ?> +
@@ -161,13 +166,11 @@
- - -
+ authorise('core.create', 'com_media')) : ?> diff --git a/administrator/components/com_media/views/imageslist/tmpl/default.php b/administrator/components/com_media/views/imageslist/tmpl/default.php index 19e73a61fe18f..caae4ea9bd2b3 100644 --- a/administrator/components/com_media/views/imageslist/tmpl/default.php +++ b/administrator/components/com_media/views/imageslist/tmpl/default.php @@ -27,7 +27,6 @@ @media (max-width: 767px) { li.imgOutline.thumbnail.height-80.width-80.center { float: right; - margin-right: 15px; } } ' @@ -40,7 +39,6 @@ @media (max-width: 767px) { li.imgOutline.thumbnail.height-80.width-80.center { float: left; - margin-left: 15px; } } ' diff --git a/administrator/components/com_media/views/imageslist/tmpl/default_image.php b/administrator/components/com_media/views/imageslist/tmpl/default_image.php index 9c8ac7308b9e5..32c1768b8d018 100644 --- a/administrator/components/com_media/views/imageslist/tmpl/default_image.php +++ b/administrator/components/com_media/views/imageslist/tmpl/default_image.php @@ -13,7 +13,7 @@ $params = new Registry; $dispatcher = JEventDispatcher::getInstance(); -$dispatcher->trigger('onContentBeforeDisplay', array('com_media.file', &$this->_tmp_img, &$params)); +$dispatcher->trigger('onContentBeforeDisplay', array('com_media.file', &$this->_tmp_img, &$params, 0)); ?>
  • @@ -27,4 +27,4 @@
  • trigger('onContentAfterDisplay', array('com_media.file', &$this->_tmp_img, &$params)); +$dispatcher->trigger('onContentAfterDisplay', array('com_media.file', &$this->_tmp_img, &$params, 0)); diff --git a/administrator/components/com_media/views/media/tmpl/default_navigation.php b/administrator/components/com_media/views/media/tmpl/default_navigation.php index 85ad2aad2452d..9e0d0b83f1598 100644 --- a/administrator/components/com_media/views/media/tmpl/default_navigation.php +++ b/administrator/components/com_media/views/media/tmpl/default_navigation.php @@ -12,7 +12,7 @@ $style = $app->getUserStateFromRequest('media.list.layout', 'layout', 'thumbs', 'word'); ?> -
    +
    diff --git a/administrator/components/com_media/views/medialist/tmpl/details_doc.php b/administrator/components/com_media/views/medialist/tmpl/details_doc.php index 749e3baf1e316..641884c0a93b5 100644 --- a/administrator/components/com_media/views/medialist/tmpl/details_doc.php +++ b/administrator/components/com_media/views/medialist/tmpl/details_doc.php @@ -15,7 +15,7 @@ $user = JFactory::getUser(); $params = new Registry; $dispatcher = JEventDispatcher::getInstance(); -$dispatcher->trigger('onContentBeforeDisplay', array('com_media.file', &$this->_tmp_doc, &$params)); +$dispatcher->trigger('onContentBeforeDisplay', array('com_media.file', &$this->_tmp_doc, &$params, 0)); ?> @@ -39,4 +39,4 @@ -trigger('onContentAfterDisplay', array('com_media.file', &$this->_tmp_doc, &$params)); +trigger('onContentAfterDisplay', array('com_media.file', &$this->_tmp_doc, &$params, 0)); diff --git a/administrator/components/com_media/views/medialist/tmpl/details_docs.php b/administrator/components/com_media/views/medialist/tmpl/details_docs.php index 152eda55474a8..6d5524c92aba0 100644 --- a/administrator/components/com_media/views/medialist/tmpl/details_docs.php +++ b/administrator/components/com_media/views/medialist/tmpl/details_docs.php @@ -17,7 +17,7 @@ ?> documents as $i => $doc) : ?> - trigger('onContentBeforeDisplay', array('com_media.file', &$doc, &$params)); ?> + trigger('onContentBeforeDisplay', array('com_media.file', &$doc, &$params, 0)); ?> canDelete) : ?> @@ -50,5 +50,5 @@ - trigger('onContentAfterDisplay', array('com_media.file', &$doc, &$params)); ?> + trigger('onContentAfterDisplay', array('com_media.file', &$doc, &$params, 0)); ?> diff --git a/administrator/components/com_media/views/medialist/tmpl/details_img.php b/administrator/components/com_media/views/medialist/tmpl/details_img.php index cb4c216200b89..6fd461ef06fb4 100644 --- a/administrator/components/com_media/views/medialist/tmpl/details_img.php +++ b/administrator/components/com_media/views/medialist/tmpl/details_img.php @@ -16,7 +16,7 @@ $user = JFactory::getUser(); $params = new Registry; $dispatcher = JEventDispatcher::getInstance(); -$dispatcher->trigger('onContentBeforeDisplay', array('com_media.file', &$this->_tmp_img, &$params)); +$dispatcher->trigger('onContentBeforeDisplay', array('com_media.file', &$this->_tmp_img, &$params, 0)); ?> @@ -39,4 +39,4 @@ -trigger('onContentAfterDisplay', array('com_media.file', &$this->_tmp_img, &$params)); +trigger('onContentAfterDisplay', array('com_media.file', &$this->_tmp_img, &$params, 0)); diff --git a/administrator/components/com_media/views/medialist/tmpl/details_imgs.php b/administrator/components/com_media/views/medialist/tmpl/details_imgs.php index 0cfc19bcbc227..edc91ee866ca7 100644 --- a/administrator/components/com_media/views/medialist/tmpl/details_imgs.php +++ b/administrator/components/com_media/views/medialist/tmpl/details_imgs.php @@ -19,7 +19,7 @@ ?> images as $i => $image) : ?> - trigger('onContentBeforeDisplay', array('com_media.file', &$image, &$params)); ?> + trigger('onContentBeforeDisplay', array('com_media.file', &$image, &$params, 0)); ?> canDelete) : ?> @@ -55,5 +55,5 @@ - trigger('onContentAfterDisplay', array('com_media.file', &$image, &$params)); ?> + trigger('onContentAfterDisplay', array('com_media.file', &$image, &$params, 0)); ?> diff --git a/administrator/components/com_media/views/medialist/tmpl/details_video.php b/administrator/components/com_media/views/medialist/tmpl/details_video.php index bd8affe2d1aa0..dc2c233b6ebef 100644 --- a/administrator/components/com_media/views/medialist/tmpl/details_video.php +++ b/administrator/components/com_media/views/medialist/tmpl/details_video.php @@ -16,7 +16,7 @@ $user = JFactory::getUser(); $params = new Registry; $dispatcher = JEventDispatcher::getInstance(); -$dispatcher->trigger('onContentBeforeDisplay', array('com_media.file', &$this->_tmp_video, &$params)); +$dispatcher->trigger('onContentBeforeDisplay', array('com_media.file', &$this->_tmp_video, &$params, 0)); JFactory::getDocument()->addScriptDeclaration(" jQuery(document).ready(function($){ @@ -51,4 +51,4 @@ trigger('onContentAfterDisplay', array('com_media.file', &$this->_tmp_video, &$params)); +$dispatcher->trigger('onContentAfterDisplay', array('com_media.file', &$this->_tmp_video, &$params, 0)); diff --git a/administrator/components/com_media/views/medialist/tmpl/details_videos.php b/administrator/components/com_media/views/medialist/tmpl/details_videos.php index 05bd8c914c218..9dee7dd6fb4af 100644 --- a/administrator/components/com_media/views/medialist/tmpl/details_videos.php +++ b/administrator/components/com_media/views/medialist/tmpl/details_videos.php @@ -26,7 +26,7 @@ ?> videos as $i => $video) : ?> - trigger('onContentBeforeDisplay', array('com_media.file', &$video, &$params)); ?> + trigger('onContentBeforeDisplay', array('com_media.file', &$video, &$params, 0)); ?> canDelete) : ?> @@ -63,5 +63,5 @@ - trigger('onContentAfterDisplay', array('com_media.file', &$video, &$params)); ?> + trigger('onContentAfterDisplay', array('com_media.file', &$video, &$params, 0)); ?> diff --git a/administrator/components/com_media/views/medialist/tmpl/thumbs_docs.php b/administrator/components/com_media/views/medialist/tmpl/thumbs_docs.php index 942e53118137e..a40fa8d74bce0 100644 --- a/administrator/components/com_media/views/medialist/tmpl/thumbs_docs.php +++ b/administrator/components/com_media/views/medialist/tmpl/thumbs_docs.php @@ -16,7 +16,7 @@ ?> documents as $i => $doc) : ?> - trigger('onContentBeforeDisplay', array('com_media.file', &$doc, &$params)); ?> + trigger('onContentBeforeDisplay', array('com_media.file', &$doc, &$params, 0)); ?>
  • canDelete) : ?> × @@ -36,5 +36,5 @@ escape($doc->name), 10, false); ?>
  • - trigger('onContentAfterDisplay', array('com_media.file', &$doc, &$params)); ?> + trigger('onContentAfterDisplay', array('com_media.file', &$doc, &$params, 0)); ?> diff --git a/administrator/components/com_media/views/medialist/tmpl/thumbs_imgs.php b/administrator/components/com_media/views/medialist/tmpl/thumbs_imgs.php index 243ddec3fd1e9..37c48c40d1fc8 100644 --- a/administrator/components/com_media/views/medialist/tmpl/thumbs_imgs.php +++ b/administrator/components/com_media/views/medialist/tmpl/thumbs_imgs.php @@ -16,7 +16,7 @@ ?> images as $i => $img) : ?> - trigger('onContentBeforeDisplay', array('com_media.file', &$img, &$params)); ?> + trigger('onContentBeforeDisplay', array('com_media.file', &$img, &$params, 0)); ?>
  • canDelete) : ?>
  • - trigger('onContentAfterDisplay', array('com_media.file', &$img, &$params)); ?> + trigger('onContentAfterDisplay', array('com_media.file', &$img, &$params, 0)); ?> diff --git a/administrator/components/com_media/views/medialist/tmpl/thumbs_videos.php b/administrator/components/com_media/views/medialist/tmpl/thumbs_videos.php index bd3292b2042cc..c7553b5272964 100644 --- a/administrator/components/com_media/views/medialist/tmpl/thumbs_videos.php +++ b/administrator/components/com_media/views/medialist/tmpl/thumbs_videos.php @@ -23,7 +23,7 @@ "); ?> videos as $i => $video) : ?> - trigger('onContentBeforeDisplay', array('com_media.file', &$video, &$params)); ?> + trigger('onContentBeforeDisplay', array('com_media.file', &$video, &$params, 0)); ?>
  • canDelete) : ?> × @@ -43,5 +43,5 @@
  • - trigger('onContentAfterDisplay', array('com_media.file', &$video, &$params)); ?> + trigger('onContentAfterDisplay', array('com_media.file', &$video, &$params, 0)); ?> diff --git a/administrator/components/com_menus/controllers/item.php b/administrator/components/com_menus/controllers/item.php index cabde2f5c6ca1..aa11ccb0ced65 100644 --- a/administrator/components/com_menus/controllers/item.php +++ b/administrator/components/com_menus/controllers/item.php @@ -358,7 +358,7 @@ public function save($key = null, $urlVar = null) $data = $model->validate($form, $data); // Preprocess request fields to ensure that we remove not set or empty request params - $request = $form->getGroup('request'); + $request = $form->getGroup('request', true); // Check for the special 'request' entry. if ($data['type'] == 'component' && !empty($request)) diff --git a/administrator/components/com_menus/models/item.php b/administrator/components/com_menus/models/item.php index 312b03177a7b2..38facb53db071 100644 --- a/administrator/components/com_menus/models/item.php +++ b/administrator/components/com_menus/models/item.php @@ -92,27 +92,19 @@ class MenusModelItem extends JModelAdmin */ protected function canDelete($record) { - $user = JFactory::getUser(); - - if (!empty($record->id)) + if (empty($record->id) || $record->published != -2) { - // Only delete trashed items - if ($record->published != -2) - { - return false; - } - - $menuTypeId = 0; + return false; + } - if (!empty($record->menutype)) - { - $menuTypeId = $this->getMenuTypeId($record->menutype); - } + $menuTypeId = 0; - return $user->authorise('core.delete', 'com_menus.menu.' . (int) $menuTypeId); + if (!empty($record->menutype)) + { + $menuTypeId = $this->getMenuTypeId($record->menutype); } - return false; + return JFactory::getUser()->authorise('core.delete', 'com_menus.menu.' . (int) $menuTypeId); } /** diff --git a/administrator/components/com_menus/models/menu.php b/administrator/components/com_menus/models/menu.php index 484c199e9cec8..308010153b025 100644 --- a/administrator/components/com_menus/models/menu.php +++ b/administrator/components/com_menus/models/menu.php @@ -45,9 +45,7 @@ class MenusModelMenu extends JModelForm */ protected function canDelete($record) { - $user = JFactory::getUser(); - - return $user->authorise('core.delete', 'com_menus.menu.' . (int) $record->id); + return JFactory::getUser()->authorise('core.delete', 'com_menus.menu.' . (int) $record->id); } /** diff --git a/administrator/components/com_menus/views/item/tmpl/edit.php b/administrator/components/com_menus/views/item/tmpl/edit.php index 5171650644fa3..4ce75f976ae3d 100644 --- a/administrator/components/com_menus/views/item/tmpl/edit.php +++ b/administrator/components/com_menus/views/item/tmpl/edit.php @@ -15,6 +15,7 @@ JHtml::_('behavior.core'); JHtml::_('behavior.tabstate'); JHtml::_('behavior.formvalidator'); +JHtml::_('formbehavior.chosen', '#jform_request_filter_tag', null, array('placeholder_text_multiple' => JText::_('JGLOBAL_TYPE_OR_SELECT_SOME_TAGS'))); JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); diff --git a/administrator/components/com_menus/views/items/tmpl/default_batch_footer.php b/administrator/components/com_menus/views/items/tmpl/default_batch_footer.php index a778ac892d94c..37106089c0cca 100644 --- a/administrator/components/com_menus/views/items/tmpl/default_batch_footer.php +++ b/administrator/components/com_menus/views/items/tmpl/default_batch_footer.php @@ -15,7 +15,7 @@ 0 && $clientId == 1)): ?> - diff --git a/administrator/components/com_messages/models/message.php b/administrator/components/com_messages/models/message.php index 0a9a3ba884b67..573340333e49d 100644 --- a/administrator/components/com_messages/models/message.php +++ b/administrator/components/com_messages/models/message.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +use Joomla\CMS\Router\Route; + /** * Private Message model. * @@ -359,10 +361,10 @@ public function save($data) // Build the email subject and message $app = JFactory::getApplication(); - $linkMode = $app->get('force_ssl', 0) >= 1 ? 1 : -1; + $linkMode = $app->get('force_ssl', 0) >= 1 ? Route::TLS_FORCE : Route::TLS_IGNORE; $sitename = $app->get('sitename'); $fromName = $fromUser->get('name'); - $siteURL = JRoute::link('administrator', 'index.php?option=com_messages&view=message&message_id=' . $table->message_id, false, $linkMode); + $siteURL = JRoute::link('administrator', 'index.php?option=com_messages&view=message&message_id=' . $table->message_id, false, $linkMode, true); $subject = html_entity_decode($table->subject, ENT_COMPAT, 'UTF-8'); $message = strip_tags(html_entity_decode($table->message, ENT_COMPAT, 'UTF-8')); @@ -461,9 +463,12 @@ public function notifySuperUsers($subject, $message, $fromUser = null) } $query = $db->getQuery(true) - ->select($db->quoteName('user_id')) - ->from($db->quoteName('#__user_usergroup_map')) - ->where($db->quoteName('group_id') . ' IN(' . implode(',', $groups) . ')'); + ->select($db->quoteName('map.user_id')) + ->from($db->quoteName('#__user_usergroup_map', 'map')) + ->join('LEFT', $db->quoteName('#__users', 'u') . ' ON ' . $db->quoteName('u.id') . ' = ' . $db->quoteName('map.user_id')) + ->where($db->quoteName('map.group_id') . ' IN(' . implode(',', $groups) . ')') + ->where($db->quoteName('u.block') . ' = 0') + ->where($db->quoteName('u.sendEmail') . ' = 1'); $userIDs = $db->setQuery($query)->loadColumn(0); diff --git a/administrator/components/com_messages/models/messages.php b/administrator/components/com_messages/models/messages.php index 1ae3262429024..856c7454aff8d 100644 --- a/administrator/components/com_messages/models/messages.php +++ b/administrator/components/com_messages/models/messages.php @@ -137,7 +137,7 @@ protected function getListQuery() if (!empty($search)) { $search = $db->quote('%' . str_replace(' ', '%', $db->escape(trim($search), true) . '%')); - $query->where('a.subject LIKE ' . $search . ' OR a.message LIKE ' . $search); + $query->where('(a.subject LIKE ' . $search . ' OR a.message LIKE ' . $search . ')'); } // Add the list ordering clause. diff --git a/administrator/components/com_modules/models/module.php b/administrator/components/com_modules/models/module.php index 7fed90b55775c..423aa4363a354 100644 --- a/administrator/components/com_modules/models/module.php +++ b/administrator/components/com_modules/models/module.php @@ -159,6 +159,9 @@ protected function batchCopy($value, $pks, $contexts) $table->position = $position; + // Copy of the Asset ID + $oldAssetId = $table->asset_id; + // Alter the title if necessary $data = $this->generateNewTitle(0, $table->title, $table->position); $table->title = $data['0']; @@ -201,6 +204,17 @@ protected function batchCopy($value, $pks, $contexts) $db->setQuery($query); $db->execute(); } + + // Copy rules + $query->clear() + ->update($db->quoteName('#__assets', 't')) + ->join('INNER', $db->quoteName('#__assets', 's') . + ' ON ' . $db->quoteName('s.id') . ' = ' . $oldAssetId + ) + ->set($db->quoteName('t.rules') . ' = ' . $db->quoteName('s.rules')) + ->where($db->quoteName('t.id') . ' = ' . $table->asset_id); + + $db->setQuery($query)->execute(); } else { @@ -288,18 +302,14 @@ protected function batchMove($value, $pks, $contexts) */ protected function canEditState($record) { - $user = JFactory::getUser(); - // Check for existing module. if (!empty($record->id)) { - return $user->authorise('core.edit.state', 'com_modules.module.' . (int) $record->id); + return JFactory::getUser()->authorise('core.edit.state', 'com_modules.module.' . (int) $record->id); } + // Default to component settings if module not known. - else - { - return parent::canEditState('com_modules'); - } + return parent::canEditState($record); } /** diff --git a/administrator/components/com_modules/views/modules/tmpl/default_batch_footer.php b/administrator/components/com_modules/views/modules/tmpl/default_batch_footer.php index 33c83723ed122..145531091c043 100644 --- a/administrator/components/com_modules/views/modules/tmpl/default_batch_footer.php +++ b/administrator/components/com_modules/views/modules/tmpl/default_batch_footer.php @@ -12,6 +12,6 @@ - diff --git a/administrator/components/com_modules/views/select/tmpl/default.php b/administrator/components/com_modules/views/select/tmpl/default.php index 91f421779abcf..6db8e46e8682b 100644 --- a/administrator/components/com_modules/views/select/tmpl/default.php +++ b/administrator/components/com_modules/views/select/tmpl/default.php @@ -23,20 +23,11 @@ escape($item->name); ?> escape(strip_tags($item->desc)), 200); ?> escape(strip_tags($item->desc)), 90); ?> - - direction != 'rtl') : ?>
  • - -
  • - - - -
  • -
    diff --git a/administrator/components/com_newsfeeds/models/newsfeed.php b/administrator/components/com_newsfeeds/models/newsfeed.php index d977387387e4c..1dc6cc978f780 100644 --- a/administrator/components/com_newsfeeds/models/newsfeed.php +++ b/administrator/components/com_newsfeeds/models/newsfeed.php @@ -54,26 +54,17 @@ class NewsfeedsModelNewsfeed extends JModelAdmin */ protected function canDelete($record) { - if (!empty($record->id)) + if (empty($record->id) || $record->published != -2) { - if ($record->published != -2) - { - return false; - } - - $user = JFactory::getUser(); + return false; + } - if (!empty($record->catid)) - { - return $user->authorise('core.delete', 'com_newsfeed.category.' . (int) $record->catid); - } - else - { - return parent::canDelete($record); - } + if (!empty($record->catid)) + { + return JFactory::getUser()->authorise('core.delete', 'com_newsfeed.category.' . (int) $record->catid); } - return false; + return parent::canDelete($record); } /** @@ -87,16 +78,12 @@ protected function canDelete($record) */ protected function canEditState($record) { - $user = JFactory::getUser(); - if (!empty($record->catid)) { - return $user->authorise('core.edit.state', 'com_newsfeeds.category.' . (int) $record->catid); - } - else - { - return parent::canEditState($record); + return JFactory::getUser()->authorise('core.edit.state', 'com_newsfeeds.category.' . (int) $record->catid); } + + return parent::canEditState($record); } /** @@ -211,20 +198,22 @@ public function save($data) JLoader::register('CategoriesHelper', JPATH_ADMINISTRATOR . '/components/com_categories/helpers/categories.php'); - // Cast catid to integer for comparison - $catid = (int) $data['catid']; + // Create new category, if needed. + $createCategory = true; - // Check if New Category exists - if ($catid > 0) + // If category ID is provided, check if it's valid. + if (is_numeric($data['catid']) && $data['catid']) { - $catid = CategoriesHelper::validateCategoryId($data['catid'], 'com_newsfeeds'); + $createCategory = !CategoriesHelper::validateCategoryId($data['catid'], 'com_newsfeeds'); } // Save New Category - if ($catid == 0 && $this->canCreateCategory()) + if ($createCategory && $this->canCreateCategory()) { $table = array(); - $table['title'] = $data['catid']; + + // Remove #new# prefix, if exists. + $table['title'] = strpos($data['catid'], '#new#') === 0 ? substr($data['catid'], 5) : $data['catid']; $table['parent_id'] = 1; $table['extension'] = 'com_newsfeeds'; $table['language'] = $data['language']; @@ -413,6 +402,9 @@ protected function preprocessForm(JForm $form, $data, $group = 'content') if ($this->canCreateCategory()) { $form->setFieldAttribute('catid', 'allowAdd', 'true'); + + // Add a prefix for categories created on the fly. + $form->setFieldAttribute('catid', 'customPrefix', '#new#'); } // Association newsfeeds items @@ -450,35 +442,6 @@ protected function preprocessForm(JForm $form, $data, $group = 'content') parent::preprocessForm($form, $data, $group); } - /** - * Method to change the title & alias. - * - * @param integer $category_id The id of the parent. - * @param string $alias The alias. - * @param string $name The title. - * - * @return array Contains the modified title and alias. - * - * @since 3.1 - */ - protected function generateNewTitle($category_id, $alias, $name) - { - // Alter the title & alias - $table = $this->getTable(); - - while ($table->load(array('alias' => $alias, 'catid' => $category_id))) - { - if ($name == $table->name) - { - $name = StringHelper::increment($name); - } - - $alias = StringHelper::increment($alias, 'dash'); - } - - return array($name, $alias); - } - /** * Is the user allowed to create an on the fly category? * diff --git a/administrator/components/com_newsfeeds/tables/newsfeed.php b/administrator/components/com_newsfeeds/tables/newsfeed.php index af9e65206d20f..130f452cd3b4f 100644 --- a/administrator/components/com_newsfeeds/tables/newsfeed.php +++ b/administrator/components/com_newsfeeds/tables/newsfeed.php @@ -35,6 +35,8 @@ public function __construct(&$db) { parent::__construct('#__newsfeeds', 'id', $db); + $this->setColumnAlias('title', 'name'); + JTableObserverTags::createObserver($this, array('typeAlias' => 'com_newsfeeds.newsfeed')); JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_newsfeeds.newsfeed')); } diff --git a/administrator/components/com_newsfeeds/views/newsfeed/tmpl/edit.php b/administrator/components/com_newsfeeds/views/newsfeed/tmpl/edit.php index bde09316ed46e..1c4943c735d35 100644 --- a/administrator/components/com_newsfeeds/views/newsfeed/tmpl/edit.php +++ b/administrator/components/com_newsfeeds/views/newsfeed/tmpl/edit.php @@ -15,6 +15,7 @@ JHtml::_('behavior.formvalidator'); JHtml::_('behavior.keepalive'); JHtml::_('formbehavior.chosen', '#jform_catid', null, array('disable_search_threshold' => 0 )); +JHtml::_('formbehavior.chosen', '#jform_tags', null, array('placeholder_text_multiple' => JText::_('JGLOBAL_TYPE_OR_SELECT_SOME_TAGS'))); JHtml::_('formbehavior.chosen', 'select'); $app = JFactory::getApplication(); diff --git a/administrator/components/com_newsfeeds/views/newsfeeds/tmpl/default_batch_footer.php b/administrator/components/com_newsfeeds/views/newsfeeds/tmpl/default_batch_footer.php index 2a71bd8c71de1..756a4165acc4d 100644 --- a/administrator/components/com_newsfeeds/views/newsfeeds/tmpl/default_batch_footer.php +++ b/administrator/components/com_newsfeeds/views/newsfeeds/tmpl/default_batch_footer.php @@ -12,6 +12,6 @@ - diff --git a/administrator/components/com_postinstall/views/messages/tmpl/default.php b/administrator/components/com_postinstall/views/messages/tmpl/default.php index df7cfe3f6a3c9..6ad6f1d529485 100644 --- a/administrator/components/com_postinstall/views/messages/tmpl/default.php +++ b/administrator/components/com_postinstall/views/messages/tmpl/default.php @@ -9,7 +9,10 @@ defined('_JEXEC') or die; -$renderer = JFactory::getDocument()->loadRenderer('module'); +use Joomla\CMS\Factory; + +$lang = Factory::getLanguage(); +$renderer = Factory::getDocument()->loadRenderer('module'); $options = array('style' => 'raw'); $mod = JModuleHelper::getModule('mod_feed'); $param = array( @@ -19,6 +22,7 @@ 'rssimage' => 1, 'rssitems' => 5, 'rssitemdesc' => 1, + 'rssrtl' => $lang->isRtl() ? 1 : 0, 'word_count' => 200, 'cache' => 0, ); @@ -61,7 +65,7 @@ action_key); ?> - authorise('core.edit.state', 'com_postinstall')) : ?> + authorise('core.edit.state', 'com_postinstall')) : ?> @@ -72,7 +76,7 @@ eid == 700) : ?>
    -
    +
    isRtl()) : ?> style="padding-right: 20px;">

    render($mod, $params, $options); ?>
    diff --git a/administrator/components/com_privacy/models/dashboard.php b/administrator/components/com_privacy/models/dashboard.php index c16b8415eaaeb..533e6562aa1bd 100644 --- a/administrator/components/com_privacy/models/dashboard.php +++ b/administrator/components/com_privacy/models/dashboard.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +use Joomla\CMS\Router\Route; + /** * Dashboard model class. * @@ -117,7 +119,7 @@ public function getRequestFormPublished() } } - $linkMode = JFactory::getApplication()->get('force_ssl', 0) == 2 ? 1 : -1; + $linkMode = JFactory::getApplication()->get('force_ssl', 0) == 2 ? Route::TLS_FORCE : Route::TLS_IGNORE; if (!$menuItem) { diff --git a/administrator/components/com_privacy/models/request.php b/administrator/components/com_privacy/models/request.php index 12cb04702532f..bf3eead939c3e 100644 --- a/administrator/components/com_privacy/models/request.php +++ b/administrator/components/com_privacy/models/request.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +use Joomla\CMS\Router\Route; + /** * Request item model class. * @@ -311,13 +313,13 @@ public function notifyUserAdminCreatedRequest($id) { $app = JFactory::getApplication(); - $linkMode = $app->get('force_ssl', 0) == 2 ? 1 : -1; + $linkMode = $app->get('force_ssl', 0) == 2 ? Route::TLS_FORCE : Route::TLS_IGNORE; $substitutions = array( '[SITENAME]' => $app->get('sitename'), '[URL]' => JUri::root(), - '[TOKENURL]' => JRoute::link('site', 'index.php?option=com_privacy&view=confirm&confirm_token=' . $token, false, $linkMode), - '[FORMURL]' => JRoute::link('site', 'index.php?option=com_privacy&view=confirm', false, $linkMode), + '[TOKENURL]' => JRoute::link('site', 'index.php?option=com_privacy&view=confirm&confirm_token=' . $token, false, $linkMode, true), + '[FORMURL]' => JRoute::link('site', 'index.php?option=com_privacy&view=confirm', false, $linkMode, true), '[TOKEN]' => $token, '\\n' => "\n", ); diff --git a/administrator/components/com_redirect/models/link.php b/administrator/components/com_redirect/models/link.php index c54536bc2a568..866f2030306b2 100644 --- a/administrator/components/com_redirect/models/link.php +++ b/administrator/components/com_redirect/models/link.php @@ -40,26 +40,7 @@ protected function canDelete($record) return false; } - $user = JFactory::getUser(); - - return $user->authorise('core.delete', 'com_redirect'); - } - - /** - * Method to test whether a record can have its state edited. - * - * @param object $record A record object. - * - * @return boolean True if allowed to change the state of the record. Defaults to the permission set in the component. - * - * @since 1.6 - */ - protected function canEditState($record) - { - $user = JFactory::getUser(); - - // Check the component since there are no categories or other assets. - return $user->authorise('core.edit.state', 'com_redirect'); + return parent::canDelete($record); } /** diff --git a/administrator/components/com_redirect/views/links/tmpl/default_batch_footer.php b/administrator/components/com_redirect/views/links/tmpl/default_batch_footer.php index 8cc36bded8058..de028b977a043 100644 --- a/administrator/components/com_redirect/views/links/tmpl/default_batch_footer.php +++ b/administrator/components/com_redirect/views/links/tmpl/default_batch_footer.php @@ -12,6 +12,6 @@ - diff --git a/administrator/components/com_tags/models/tag.php b/administrator/components/com_tags/models/tag.php index 6936e771531e5..4871c953fa63d 100644 --- a/administrator/components/com_tags/models/tag.php +++ b/administrator/components/com_tags/models/tag.php @@ -53,29 +53,12 @@ class TagsModelTag extends JModelAdmin */ protected function canDelete($record) { - if (!empty($record->id)) + if (empty($record->id) || $record->published != -2) { - if ($record->published != -2) - { - return false; - } - - return parent::canDelete($record); + return false; } - } - /** - * Method to test whether a record can have its state changed. - * - * @param object $record A record object. - * - * @return boolean True if allowed to change the state of the record. Defaults to the permission set in the component. - * - * @since 3.1 - */ - protected function canEditState($record) - { - return parent::canEditState($record); + return parent::canDelete($record); } /** diff --git a/administrator/components/com_tags/views/tags/tmpl/default_batch_footer.php b/administrator/components/com_tags/views/tags/tmpl/default_batch_footer.php index 6d51a9b83046c..c201d83a467f8 100644 --- a/administrator/components/com_tags/views/tags/tmpl/default_batch_footer.php +++ b/administrator/components/com_tags/views/tags/tmpl/default_batch_footer.php @@ -12,6 +12,6 @@ - diff --git a/administrator/components/com_templates/models/template.php b/administrator/components/com_templates/models/template.php index fe224e971f315..c3c6c1b528739 100644 --- a/administrator/components/com_templates/models/template.php +++ b/administrator/components/com_templates/models/template.php @@ -330,8 +330,8 @@ protected function fixTemplateName() foreach ($files as $file) { - $newFile = str_replace($oldName, $newName, $file); - $result = JFile::move($file, $newFile) && $result; + $newFile = '/' . str_replace($oldName, $newName, basename($file)); + $result = JFile::move($file, dirname($file) . $newFile) && $result; } // Edit XML file diff --git a/administrator/components/com_templates/views/style/tmpl/edit_assignment.php b/administrator/components/com_templates/views/style/tmpl/edit_assignment.php index 060568c5d2035..db4a806f89f1d 100644 --- a/administrator/components/com_templates/views/style/tmpl/edit_assignment.php +++ b/administrator/components/com_templates/views/style/tmpl/edit_assignment.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -// Initiasile related data. +// Initialise related data. JLoader::register('MenusHelper', JPATH_ADMINISTRATOR . '/components/com_menus/helpers/menus.php'); $menuTypes = MenusHelper::getMenuLinks(); $user = JFactory::getUser(); @@ -26,14 +26,14 @@
  • - trigger('onContentAfterDisplay', array('com_media.file', &$img, &$params)); ?> + trigger('onContentAfterDisplay', array('com_media.file', &$img, &$params, 0)); ?> diff --git a/administrator/templates/isis/html/layouts/joomla/form/field/media.php b/administrator/templates/isis/html/layouts/joomla/form/field/media.php index 7aae95b749d3b..31e095b23dfc8 100644 --- a/administrator/templates/isis/html/layouts/joomla/form/field/media.php +++ b/administrator/templates/isis/html/layouts/joomla/form/field/media.php @@ -93,7 +93,7 @@ data-url="" data-modal=".modal" data-modal-width="100%" - data-modal-height="400px" + data-modal-height="645px" data-input=".field-media-input" data-button-select=".button-select" data-button-clear=".button-clear" @@ -112,7 +112,6 @@ array( 'title' => JText::_('JLIB_FORM_CHANGE_IMAGE'), 'closeButton' => true, - 'footer' => '', ) ); diff --git a/administrator/templates/isis/index.php b/administrator/templates/isis/index.php index 0113ee88c8700..ce3f798025c85 100644 --- a/administrator/templates/isis/index.php +++ b/administrator/templates/isis/index.php @@ -89,7 +89,7 @@ // Logo file if ($this->params->get('logoFile')) { - $logo = JUri::root() . $this->params->get('logoFile'); + $logo = JUri::root() . htmlspecialchars($this->params->get('logoFile'), ENT_QUOTES); } else { @@ -218,7 +218,7 @@ function colorIsLight($color)
  • - name; ?> + name, ENT_QUOTES, 'UTF-8'); ?>
  • diff --git a/administrator/templates/isis/language/en-GB/en-GB.tpl_isis.ini b/administrator/templates/isis/language/en-GB/en-GB.tpl_isis.ini index 28d0fdd32a30f..1574c77da1b09 100644 --- a/administrator/templates/isis/language/en-GB/en-GB.tpl_isis.ini +++ b/administrator/templates/isis/language/en-GB/en-GB.tpl_isis.ini @@ -1,6 +1,6 @@ ; Joomla! Project ; Copyright (C) 2005 - 2019 Open Source Matters. All rights reserved. -; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php +; License GNU General Public License version 2 or later; see LICENSE.txt ; Note : All ini files need to be saved as UTF-8 ISIS="Isis Administrator template" diff --git a/administrator/templates/isis/language/en-GB/en-GB.tpl_isis.sys.ini b/administrator/templates/isis/language/en-GB/en-GB.tpl_isis.sys.ini index 9498180fde9e9..c7588c48ce46d 100644 --- a/administrator/templates/isis/language/en-GB/en-GB.tpl_isis.sys.ini +++ b/administrator/templates/isis/language/en-GB/en-GB.tpl_isis.sys.ini @@ -1,6 +1,6 @@ ; Joomla! Project ; Copyright (C) 2005 - 2019 Open Source Matters. All rights reserved. -; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php +; License GNU General Public License version 2 or later; see LICENSE.txt ; Note : All ini files need to be saved as UTF-8 ISIS="Isis Administrator template" diff --git a/administrator/templates/isis/less/blocks/_custom.less b/administrator/templates/isis/less/blocks/_custom.less index 0a76f4086f37c..219a2e7d65b5c 100644 --- a/administrator/templates/isis/less/blocks/_custom.less +++ b/administrator/templates/isis/less/blocks/_custom.less @@ -165,11 +165,6 @@ th .tooltip-inner { max-height: 100%; } -/* Help site refresh button*/ -#helpsite-refresh { - padding: 4px 12px; - vertical-align: top; -} .alert-no-items { margin-top: 20px; } diff --git a/administrator/templates/isis/less/blocks/_media.less b/administrator/templates/isis/less/blocks/_media.less index 8154a7c527117..1116a7dfd6b1f 100644 --- a/administrator/templates/isis/less/blocks/_media.less +++ b/administrator/templates/isis/less/blocks/_media.less @@ -1,5 +1,10 @@ // Media +/* Spacing below buttons in media manager */ +.ventral-space{ + margin-bottom: 5px; +} + /* Media Manager folder icon override */ ul.manager .height-50 .icon-folder-2 { height: 35px; @@ -9,14 +14,12 @@ ul.manager .height-50 .icon-folder-2 { } #imageForm { - margin: -25px 0 0; .well { margin-bottom: 5px; } } .thumbnails-media { @thumbSize:100px; - margin-left: 0; .thumbnail { background-color: #f4f4f4; border-radius: @inputBorderRadius; @@ -25,8 +28,7 @@ ul.manager .height-50 .icon-folder-2 { padding: 0px; height: @thumbSize; width: @thumbSize; - margin: 8px 16px; - margin-left: 0 !important; + margin: 8px; position: relative; text-align: center; overflow: hidden; @@ -203,6 +205,7 @@ ul.manager .height-50 .icon-folder-2 { } #mediamanager-form { margin: 0 -10px; + overflow-x: hidden; > .muted { padding: 0px; } @@ -214,10 +217,12 @@ ul.manager .height-50 .icon-folder-2 { } } .thumbnails { + margin: 0 -8px; + overflow-x: hidden; .thumbnail { height: 120px; width: 120px; - margin: 0 18px 18px 0; + margin: 8px } .imgThumb label, .imgTotal { line-height: 120px; diff --git a/administrator/templates/isis/less/blocks/_modals.less b/administrator/templates/isis/less/blocks/_modals.less index 18c3e3ea24395..f4e57c43ab674 100644 --- a/administrator/templates/isis/less/blocks/_modals.less +++ b/administrator/templates/isis/less/blocks/_modals.less @@ -25,6 +25,7 @@ body.modal-open { padding: 0; width: 100%; height: auto; + max-height: none; .container-fluid { padding-top: 15px; padding-bottom: 15px; @@ -46,7 +47,12 @@ body.modal-open { } } -/* Component pop-up */ +// Component pop-up .container-popup { - padding: 28px 10px 10px 10px; + padding: 10px; +} + +// Media modal +.field-media-wrapper iframe { + max-height: 75vh; } \ No newline at end of file diff --git a/administrator/templates/isis/less/pages/_com_templates.less b/administrator/templates/isis/less/pages/_com_templates.less index ea4e71e1b2329..d175cd51e549d 100644 --- a/administrator/templates/isis/less/pages/_com_templates.less +++ b/administrator/templates/isis/less/pages/_com_templates.less @@ -12,11 +12,13 @@ -webkit-column-gap: 15px; column-gap: 15px; > li { + display: inline-block; vertical-align: top; margin-bottom: 15px; width: 100%; list-style: none; page-break-inside: avoid; + break-inside: avoid; } } .menu-links-block { diff --git a/administrator/templates/isis/less/template-rtl.less b/administrator/templates/isis/less/template-rtl.less index e25bd2b327594..bea733e24b7f8 100644 --- a/administrator/templates/isis/less/template-rtl.less +++ b/administrator/templates/isis/less/template-rtl.less @@ -440,3 +440,9 @@ a.grid_true { left: 0; right: auto; } + +/* CPanel Site Information mod_stats_admin */ +.com_cpanel .well > .row-striped > .row-fluid [class*="span"], +.com_cpanel .well > .list-striped > .row-fluid [class*="span"] { + margin-right: 0; +} diff --git a/administrator/templates/isis/login.php b/administrator/templates/isis/login.php index f4884630aa6eb..4a2a09bb836bb 100644 --- a/administrator/templates/isis/login.php +++ b/administrator/templates/isis/login.php @@ -113,7 +113,7 @@ function colorIsLight($color)
    - get('show_title') || $params->get('show_author')) : ?> + get('show_title')) : ?>