diff --git a/CHANGELOG b/CHANGELOG index d027206..7b393d4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,13 @@ +===================================================================== +JED Checker 2.1.0 - Released 9-March-2019 +===================================================================== ++ Compatibility with Joomla 4 ++ Rule INFO_XML ++ Update Server Requirement +~ Copyright updated to Joomla! / OSM + ===================================================================== JED Checker 2.0 - Released 2-April-2017 ===================================================================== diff --git a/README.md b/README.md index a799b93..0fd216a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ -JED Checker -========== +# JED Checker This extension is able to check your components, modules or plugins for common errors that will prevent you from publishing your extension on the JED (Joomla! Extensions Directory). @@ -7,10 +6,12 @@ from publishing your extension on the JED (Joomla! Extensions Directory). If you are a developer and want to contribute to this extension you can fork this repo. ## Uploading your package + After installing this extension in your Joomla! backend, you can use it by uploading a Joomla! extension-package using the upload-button. Once uploaded, the contents of the package (your files) will be checked against JED-rules. ## Adding rules + If you want to write a rule have a look a the `administrator/components/com_jedchecker/library/rules` folder. You just need to add a new file with your rule, for example `yourrule.php`. @@ -23,25 +24,24 @@ If you are going to contribute your rule to the project, then make sure that it and that it passes the code sniffer: http://docs.joomla.org/Joomla_CodeSniffer ## Checking on existing files and folders + The extension also supports a scan of a pre-defined set of existing files and folders. For this to work, add a list of folders to a textfile `tmp/jed_checker/local.txt`. -There should be a folder on each line. +There should be a folder on each line. Once the file exists, a "Check" button becomes visible in the jedchecker-toolbar. Just hit it. Example `tmp/jed_checker/local.txt` file: - components/com_weblinks - administrator/components/com_weblinks + components/com_jedchecker + administrator/components/com_jedchecker plugins/system - ## COPYRIGHT AND DISCLAIMER -Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. + +Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/. - -This extension was previously maintained by Compojoom. diff --git a/administrator/components/com_jedchecker/controller.php b/administrator/components/com_jedchecker/controller.php index f8dba21..3cebe3a 100644 --- a/administrator/components/com_jedchecker/controller.php +++ b/administrator/components/com_jedchecker/controller.php @@ -1,10 +1,9 @@ - * @date 26.10.15 + * @package Joomla.JEDChecker * - * @copyright Copyright (C) 2008 - 2015 compojoom.com . All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die ('Restricted access'); diff --git a/administrator/components/com_jedchecker/controllers/police.raw.php b/administrator/components/com_jedchecker/controllers/police.raw.php index e927501..319be2a 100644 --- a/administrator/components/com_jedchecker/controllers/police.raw.php +++ b/administrator/components/com_jedchecker/controllers/police.raw.php @@ -1,10 +1,9 @@ - * @date 26.10.15 + * @package Joomla.JEDChecker * - * @copyright Copyright (C) 2008 - 2015 compojoom.com . All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die('Restricted access'); @@ -28,7 +27,7 @@ class JedcheckerControllerPolice extends JControllerLegacy */ public function check() { - $rule = JRequest::getString('rule'); + $rule = JFactory::getApplication()->input->get('rule', null); JLoader::discover('jedcheckerRules', JPATH_COMPONENT_ADMINISTRATOR . '/libraries/rules/'); diff --git a/administrator/components/com_jedchecker/controllers/uploads.php b/administrator/components/com_jedchecker/controllers/uploads.php index cb8ce92..49e2a1b 100644 --- a/administrator/components/com_jedchecker/controllers/uploads.php +++ b/administrator/components/com_jedchecker/controllers/uploads.php @@ -1,10 +1,9 @@ - * @date 26.10.15 + * @package Joomla.JEDChecker * - * @copyright Copyright (C) 2008 - 2015 compojoom.com . All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die('Restricted access'); @@ -13,6 +12,8 @@ jimport('joomla.filesystem'); jimport('joomla.filesystem.folder'); jimport('joomla.filesystem.archive'); +use Joomla\Archive\Archive; + /** * Class JedcheckerControllerUploads * @@ -20,6 +21,11 @@ jimport('joomla.filesystem.archive'); */ class JedcheckerControllerUploads extends JControllerlegacy { + +var $path = null; +var $pathArchive = null; +var $pathUnzipped = null; + /** * Constructor. * @@ -41,14 +47,14 @@ class JedcheckerControllerUploads extends JControllerlegacy { $appl = JFactory::getApplication(); $input = JFactory::getApplication()->input; - + // Check the sent token by the form JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); // Gets the uploaded file from the sent form $file = $input->files->get('extension', null, 'raw'); - if ($file['tmp_name']) + if ( $file['tmp_name'] ) { $path = $this->pathArchive; @@ -83,14 +89,21 @@ class JedcheckerControllerUploads extends JControllerlegacy { // Error in upload - redirect back with an error notice JFactory::getApplication()->enqueueMessage(JText::_('COM_JEDCHECKER_ERROR_UNABLE_TO_UPLOAD_FILE'), 'error'); - $this->setRedirect('index.php?option=com_jedchecker&view=uploads'); + $appl->redirect('index.php?option=com_jedchecker&view=uploads'); return false; } - $appl->redirect('index.php?option=com_jedchecker&view=uploads', JText::_('COM_JEDCHECKER_UPLOAD_WAS_SUCCESSFUL')); + // Unzip uploaded files + $unzip_result = $this->unzip(); + + $this->setRedirect( 'index.php?option=com_jedchecker&view=uploads' ); + return true; + } else { + + $this->setRedirect('index.php?option=com_jedchecker&view=uploads'); } return false; @@ -104,7 +117,7 @@ class JedcheckerControllerUploads extends JControllerlegacy public function unzip() { $appl = JFactory::getApplication(); - + // Form check token JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); @@ -125,22 +138,36 @@ class JedcheckerControllerUploads extends JControllerlegacy } $file = JFolder::files($this->pathArchive); - $result = JArchive::extract($this->pathArchive . '/' . $file[0], $this->pathUnzipped . '/' . $file[0]); + + $origin = $this->pathArchive . DIRECTORY_SEPARATOR . $file[0]; + $destination = $this->pathUnzipped . DIRECTORY_SEPARATOR . $file[0]; + + try + { + $archive = new Archive; + $result = $archive->extract($origin, $destination); + } + catch (\Exception $e) + { + $result = false; + } if ($result) { // Scan unzipped folders if we find zip file -> unzip them as well $this->unzipAll($this->pathUnzipped . '/' . $file[0]); $message = 'COM_JEDCHECKER_UNZIP_SUCCESS'; + JFactory::getApplication()->enqueueMessage(JText::_($message)); } else { $message = 'COM_JEDCHECKER_UNZIP_FAILED'; } - $appl->redirect('index.php?option=com_jedchecker&view=uploads', JText::_($message)); + //$appl->redirect('index.php?option=com_jedchecker&view=uploads', JText::_($message)); + $message = 'COM_JEDCHECKER_UNZIP_FAILED'; - return $result; + return $message; } /** @@ -163,7 +190,15 @@ class JedcheckerControllerUploads extends JControllerlegacy if ($extension == 'zip') { $unzip = $file->getPath() . '/' . $file->getBasename('.' . $extension); - $result = JArchive::extract($file->getPathname(), $unzip); + try + { + $archive = new Archive; + $result = $archive->extract($file->getPathname(), $unzip); + } + catch (\Exception $e) + { + $result = false; + } // Delete the archive once we extract it if ($result) @@ -181,4 +216,28 @@ class JedcheckerControllerUploads extends JControllerlegacy } } } + + /** + * clear tmp folders + * + */ + public function clear() + { + if ( file_exists($this->path) ) + { + $result = JFolder::delete($this->path); + + if (!$result) + { + echo 'could not delete ' . $this->path; + $message = 'COM_JEDCHECKER_DELETE_FAILED'; + } + + $message = 'COM_JEDCHECKER_DELETE_SUCCESS'; + + //JFactory::getApplication()->redirect('index.php?option=com_jedchecker&view=uploads', JText::_($message)); + $this->setRedirect( 'index.php?option=com_jedchecker&view=uploads' ); + + } + } } diff --git a/administrator/components/com_jedchecker/jedchecker.php b/administrator/components/com_jedchecker/jedchecker.php index 04850d8..45047b2 100644 --- a/administrator/components/com_jedchecker/jedchecker.php +++ b/administrator/components/com_jedchecker/jedchecker.php @@ -1,16 +1,15 @@ authorise('core.manage', 'com_jedchecker')) +if (!JFactory::getUser()->authorise('core.manage', 'com_jedchecker')) { throw new Exception(JText::_('JERROR_ALERTNOAUTHOR')); } diff --git a/administrator/components/com_jedchecker/jedchecker.xml b/administrator/components/com_jedchecker/jedchecker.xml deleted file mode 100644 index 60e57cd..0000000 --- a/administrator/components/com_jedchecker/jedchecker.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - COM_@@COMPONENTNAMEUPPERCASE@@ - Compojoom.com - @@DATE@@ - (C) 2012 compojoom.com - daniel@compojoom.com - www.compojoom.com - @@VERSION@@ - http://www.gnu.org/copyleft/gpl.html GNU/GPL - - - script.php - - COM_@@COMPONENTNAMEUPPERCASE@@ - - ##ADMINCOMPONENTPACKAGEFILES## - - - - ##MEDIAPACKAGEFILES## - - - - - \ No newline at end of file diff --git a/administrator/components/com_jedchecker/language/da-DK/da-DK.com_jedchecker.ini b/administrator/components/com_jedchecker/language/da-DK/da-DK.com_jedchecker.ini index 05e1166..3fee759 100644 --- a/administrator/components/com_jedchecker/language/da-DK/da-DK.com_jedchecker.ini +++ b/administrator/components/com_jedchecker/language/da-DK/da-DK.com_jedchecker.ini @@ -13,7 +13,8 @@ COM_JEDCHECKER_STEP1="Upload din komponent /plugin /modul zip-fil ved hjælp af COM_JEDCHECKER_STEP2="Klik på Unzip" COM_JEDCHECKER_STEP3="Klik på Kontroller og gennemgå resultaterne" COM_JEDCHECKER_WALL_OF_HONOR="Wall of Honour" -COM_JEDCHECKER_PEOPLE_THAT_HAVE_HELPED_WITH_THE_DEVELOPMENT="Folk, der har hjulpet med udviklingen af ​​denne komponent. (I nogen bestemt rækkefølge!)" +COM_JEDCHECKER_CONTRIBUTORS="Contributors" +COM_JEDCHECKER_PEOPLE_THAT_HAVE_HELPED_WITH_THE_DEVELOPMENT="Folk, der har hjulpet med udviklingen af ​​denne komponent." COM_JEDCHECKER_HOW_TO_INTERPRET_RESULTS="Sådan fortolke resultaterne" COM_JEDCHECKER_RULE_PH2="PHP filer mangler JEXEC sikkerhed" COM_JEDCHECKER_RULE_PH2_DESC="Alle PHP-filer i din udvidelse skal have en defined('_JEXEC') or die(); erklæring i begyndelsen af ​​hver fil. Dette sikrer, at filen ikke kan åbnes uden for installation Joomla og øger sikkerheden for dit websted." diff --git a/administrator/components/com_jedchecker/language/en-GB/en-GB.com_jedchecker.ini b/administrator/components/com_jedchecker/language/en-GB/en-GB.com_jedchecker.ini index a3e77ca..7231b32 100644 --- a/administrator/components/com_jedchecker/language/en-GB/en-GB.com_jedchecker.ini +++ b/administrator/components/com_jedchecker/language/en-GB/en-GB.com_jedchecker.ini @@ -10,17 +10,17 @@ COM_JEDCHECKER_CONGRATS="Congratulations! If you use this component then you've COM_JEDCHECKER_CODE_STANDARDS="However, this is not the only goal. We also aim to have code standards checks, such as those that the JPlatform has. This would ensure that Joomla extension developers are aware of the JPlatform coding standards and this could raise the quality bar in our Joomla community even higher. For this we will need you - have a look at the Github project page. Fork the component, add your code checks and send us your pull requests!" COM_JEDCHECKER_HOW_TO_USE="How to check your extension using the JED Checker:" COM_JEDCHECKER_STEP1="Upload your component/plugin/module zip file by using the upload form below" -COM_JEDCHECKER_STEP2="Click on Unzip" -COM_JEDCHECKER_STEP3="Click on Check and review the results" +COM_JEDCHECKER_STEP2="Click on Check and review the results" COM_JEDCHECKER_WALL_OF_HONOR="Wall of Honour" -COM_JEDCHECKER_PEOPLE_THAT_HAVE_HELPED_WITH_THE_DEVELOPMENT="People that have helped with the development of this component. (in no particular order!)" +COM_JEDCHECKER_CONTRIBUTORS="Contributors" +COM_JEDCHECKER_PEOPLE_THAT_HAVE_HELPED_WITH_THE_DEVELOPMENT="People that have helped with the development of this component." COM_JEDCHECKER_HOW_TO_INTERPRET_RESULTS="How to Interpret the Results" COM_JEDCHECKER_RULE_PH2="PHP Files missing JEXEC security" COM_JEDCHECKER_RULE_PH2_DESC="All the PHP files in your extension needs to have a defined('_JEXEC') or die(); statement in the beginning of each file. This ensures that the file cannot be opened outside of the joomla installation and increases the security of your site." COM_JEDCHECKER_RULE_PH3="License tag missing or incorrect in XML install file" COM_JEDCHECKER_RULE_PH3_DESC="An install file should include the license information in a license-tag. The license must be GPL or GPL compatible." COM_JEDCHECKER_EVERYTHING_SEEMS_TO_BE_FINE_WITH_THAT_RULE="Congratulations, everything seems to be fine with that rule!" -COM_JEDCHECKER_DEVELOPED_BY="JED Checker is primary developed by compojoom.com" +COM_JEDCHECKER_DEVELOPED_BY="JED Checker is a JED proyect." COM_JEDCHECKER_PHP_VERSION_INCOMPATIBLE="JED Checker is incompatible with the PHP version that you run on this site: %s. You would need at least PHP Version %s. Aborting installation" COM_JEDCHECKER_ERROR_HTML_INDEX_NOT_FOUND="Missing index.html in this directory." COM_JEDCHECKER_ERROR_JEXEC_NOT_FOUND="The JEXEC security check was not found in this file." @@ -40,7 +40,7 @@ COM_JEDCHECKER_LEAVE_A_REVIEW_JED="If you use this component, please post a rati COM_JEDCHECKER_INFO="Info" COM_JEDCHECKER_INFO_XML="Information about extension xml files" COM_JEDCHECKER_INFO_XML_DESC="The install name of your extension must match your listing name on JED. We scan the xml files and find the value of the name tag. Useful information for the "filename and install as" fields in the jed submission form" -COM_JEDCHECKER_INFO_XML_NAME_XML="The name tag in this file is: %s" +COM_JEDCHECKER_INFO_XML_NAME_XML="The name tag in this file is: %s" COM_JEDCHECKER_INFO_XML_VERSION_XML="Version tag has the value: %s" COM_JEDCHECKER_INFO_XML_CREATIONDATE_XML="The creationDate tag has the value: %s" COM_JEDCHECKER_RULE_PH1="PHP Headers missing GPL License Notice" @@ -75,3 +75,6 @@ COM_JEDCHECKER_RULE_US1_DESC="The use of Update Servers is now required by JED." COM_JEDCHECKER_ERROR_XML_UPDATE_SERVER_NOT_FOUND="Update Server tag missing or incorrect in this XML file" COM_JEDCHECKER_ERROR_XML_UPDATE_SERVER_LINK_NOT_FOUND="Update Server link not found in this XML file" COM_JEDCHECKER_INFO_XML_UPDATE_SERVER_LINK="The Update Server link in this XML file is: %s" +COM_JEDCHECKER_DELETE_FAILED="Can't delete temporary folder" +COM_JEDCHECKER_DELETE_SUCCESS="Temporary folder deleted!" +COM_JEDCHECKER_EMPTY_UPLOAD_FIELD="Please, select a zipped file to be uploaded" \ No newline at end of file diff --git a/administrator/components/com_jedchecker/language/es-ES/es-ES.com_jedchecker.ini b/administrator/components/com_jedchecker/language/es-ES/es-ES.com_jedchecker.ini index 87f3939..37d89c5 100644 --- a/administrator/components/com_jedchecker/language/es-ES/es-ES.com_jedchecker.ini +++ b/administrator/components/com_jedchecker/language/es-ES/es-ES.com_jedchecker.ini @@ -13,7 +13,8 @@ COM_JEDCHECKER_STEP1="Cargue su archivo zip componente / plugin / módulo usando COM_JEDCHECKER_STEP2="Haga clic en Unzip" COM_JEDCHECKER_STEP3="Haga clic en Verificar y revisar los resultados" COM_JEDCHECKER_WALL_OF_HONOR="Muro de Honor" -COM_JEDCHECKER_PEOPLE_THAT_HAVE_HELPED_WITH_THE_DEVELOPMENT="Personas que han ayudado con el desarrollo de este componente (¡en ningún orden particular!)" +COM_JEDCHECKER_CONTRIBUTORS="Contribuidores" +COM_JEDCHECKER_PEOPLE_THAT_HAVE_HELPED_WITH_THE_DEVELOPMENT="Personas que han ayudado con el desarrollo de este componente." COM_JEDCHECKER_HOW_TO_INTERPRET_RESULTS="Cómo interpretar los resultados" COM_JEDCHECKER_RULE_PH2="Archivos PHP que carecen de seguridad JEXEC" COM_JEDCHECKER_RULE_PH2_DESC="Todos los archivos PHP de su extensión necesitan tener una sentencia defined('_JEXEC') or die(); en el principio de cada archivo. Esto asegura que el archivo no se puede abrir fuera de la instalación joomla e incrementa la seguridad De su sitio. " diff --git a/administrator/components/com_jedchecker/language/it-IT/it-IT.com_jedchecker.ini b/administrator/components/com_jedchecker/language/it-IT/it-IT.com_jedchecker.ini index 15ecf9f..b2d815d 100644 --- a/administrator/components/com_jedchecker/language/it-IT/it-IT.com_jedchecker.ini +++ b/administrator/components/com_jedchecker/language/it-IT/it-IT.com_jedchecker.ini @@ -13,7 +13,8 @@ COM_JEDCHECKER_STEP1="Carica il tuo / / file zip modulo plug componente utilizza COM_JEDCHECKER_STEP2="Fare clic su Unzip" COM_JEDCHECKER_STEP3="Fare clic su Verifica e rivedere i risultati" COM_JEDCHECKER_WALL_OF_HONOR="Wall of Honour" -COM_JEDCHECKER_PEOPLE_THAT_HAVE_HELPED_WITH_THE_DEVELOPMENT="Le persone che hanno contribuito allo sviluppo di questo componente. (In nessun ordine particolare!)" +COM_JEDCHECKER_CONTRIBUTORS="Contributori" +COM_JEDCHECKER_PEOPLE_THAT_HAVE_HELPED_WITH_THE_DEVELOPMENT="Le persone che hanno contribuito allo sviluppo di questo componente." COM_JEDCHECKER_HOW_TO_INTERPRET_RESULTS="Come interpretare i risultati" COM_JEDCHECKER_RULE_PH2="PHP file di sicurezza mancante jexec" COM_JEDCHECKER_RULE_PH2_DESC="Tutti i file PHP in proprio interno ha bisogno di avere un defined('_JEXEC') or die(); Dichiarazione all'inizio di ogni file Questo assicura che il file non può essere aperto al di fuori dell'impianto di joomla e aumenta la sicurezza del tuo sito. " diff --git a/administrator/components/com_jedchecker/language/pt-BR/pt-BR.com_jedchecker.ini b/administrator/components/com_jedchecker/language/pt-BR/pt-BR.com_jedchecker.ini index 1f1f86c..ecf6eb3 100644 --- a/administrator/components/com_jedchecker/language/pt-BR/pt-BR.com_jedchecker.ini +++ b/administrator/components/com_jedchecker/language/pt-BR/pt-BR.com_jedchecker.ini @@ -9,7 +9,8 @@ COM_JEDCHECKER_STEP1="Envie seu arquivo zip component/plugin/module utilizando o COM_JEDCHECKER_STEP2="Clique em descompactar" COM_JEDCHECKER_STEP3="Clique em checar e veja os resultados" COM_JEDCHECKER_WALL_OF_HONOR="Parede de honra" -COM_JEDCHECKER_PEOPLE_THAT_HAVE_HELPED_WITH_THE_DEVELOPMENT="Pessoas que contribuíram com o desenvolvimento deste componente" +COM_JEDCHECKER_CONTRIBUTORS="Contribuintes" +COM_JEDCHECKER_PEOPLE_THAT_HAVE_HELPED_WITH_THE_DEVELOPMENT="Pessoas que contribuíram com o desenvolvimento deste componente." COM_JEDCHECKER_HOW_TO_INTERPRET_RESULTS="Como interpretar os resultados?" COM_JEDCHECKER_RULE_SE1="Regra:SE1 - Extensão sem o arquivo index.html em todas as pastas" ; COM_JEDCHECKER_RULE_SE1_DESC="If you want your extension to be listed on the JED, then you should make sure that all your extension folders contain an index.html file. - Developers don't like this rule at all - it fills your package with index.html files, which in terms slows down the installation process etc. But index.html files provide protection for badly configured hosts (one could argue if we need to try to do anything for those), but as long the joomla CMS comes with those files the JED is going to require that extensions also have those." diff --git a/administrator/components/com_jedchecker/language/pt-PT/pt-PT.com_jedchecker.ini b/administrator/components/com_jedchecker/language/pt-PT/pt-PT.com_jedchecker.ini index 788c1fd..aefe366 100644 --- a/administrator/components/com_jedchecker/language/pt-PT/pt-PT.com_jedchecker.ini +++ b/administrator/components/com_jedchecker/language/pt-PT/pt-PT.com_jedchecker.ini @@ -9,7 +9,8 @@ COM_JEDCHECKER_HOW_TO_USE="Como usar este componente?" COM_JEDCHECKER_STEP2="Clique em descompactar" COM_JEDCHECKER_STEP3="Clique para rever os resultados" COM_JEDCHECKER_WALL_OF_HONOR="Quadro de honra" -; COM_JEDCHECKER_PEOPLE_THAT_HAVE_HELPED_WITH_THE_DEVELOPMENT="People that have helped with the development of this component" +COM_JEDCHECKER_CONTRIBUTORS="Contribuintes" +; COM_JEDCHECKER_PEOPLE_THAT_HAVE_HELPED_WITH_THE_DEVELOPMENT="People that have helped with the development of this component." COM_JEDCHECKER_HOW_TO_INTERPRET_RESULTS="Como interpretar os resultados" COM_JEDCHECKER_RULE_SE1="Regra:SE1 - Necessário incluir um ficheiro index.html em todas as pastas da extensão" ; COM_JEDCHECKER_RULE_SE1_DESC="If you want your extension to be listed on the JED, then you should make sure that all your extension folders contain an index.html file. - Developers don't like this rule at all - it fills your package with index.html files, which in terms slows down the installation process etc. But index.html files provide protection for badly configured hosts (one could argue if we need to try to do anything for those), but as long the joomla CMS comes with those files the JED is going to require that extensions also have those." diff --git a/administrator/components/com_jedchecker/libraries/rules/encoding.ini b/administrator/components/com_jedchecker/libraries/rules/encoding.ini index 4dc6f42..25afeb7 100644 --- a/administrator/components/com_jedchecker/libraries/rules/encoding.ini +++ b/administrator/components/com_jedchecker/libraries/rules/encoding.ini @@ -1,10 +1,6 @@ -; This is the configuration file of the encoding rule. -; -; @author Daniel Dimitrov -; @date 07/06/2012 -; @copyright Copyright (C) 2008 - 2012 compojoom.com . All rights reserved. -; @license GNU General Public License version 2 or later; see LICENSE - +; @package Joomla.JEDChecker +; @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. +; @license GNU General Public License version 2 or later; see LICENSE.txt ; The valid constants to search for encodings ="base64" diff --git a/administrator/components/com_jedchecker/libraries/rules/encoding.php b/administrator/components/com_jedchecker/libraries/rules/encoding.php index 4ff69be..87e19f6 100644 --- a/administrator/components/com_jedchecker/libraries/rules/encoding.php +++ b/administrator/components/com_jedchecker/libraries/rules/encoding.php @@ -1,9 +1,9 @@ - * @date 04/08/2012 - * @copyright Copyright (C) 2008 - 2012 compojoom.com . All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @package Joomla.JEDChecker + * + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die('Restricted access'); diff --git a/administrator/components/com_jedchecker/libraries/rules/errorreporting.ini b/administrator/components/com_jedchecker/libraries/rules/errorreporting.ini index 0adbe81..a3bdeaf 100644 --- a/administrator/components/com_jedchecker/libraries/rules/errorreporting.ini +++ b/administrator/components/com_jedchecker/libraries/rules/errorreporting.ini @@ -1,10 +1,6 @@ -; This is the configuration file of the error reporting rule. -; -; @author Denis Dulici -; @date 18/08/2013 -; @copyright Copyright (C) 2008 - 2013 mijosoft.com . All rights reserved. -; @license GNU General Public License version 2 or later; see LICENSE - +; @package Joomla.JEDChecker +; @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. +; @license GNU General Public License version 2 or later; see LICENSE.txt ; The valid constants to search for errorreportings="error_reporting(0)" diff --git a/administrator/components/com_jedchecker/libraries/rules/errorreporting.php b/administrator/components/com_jedchecker/libraries/rules/errorreporting.php index 1c2a59e..e377f56 100644 --- a/administrator/components/com_jedchecker/libraries/rules/errorreporting.php +++ b/administrator/components/com_jedchecker/libraries/rules/errorreporting.php @@ -1,9 +1,9 @@ - * @date 18.08.2013 - * @copyright Copyright (C) 2008 - 2013 mijosoft.com . All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @package Joomla.JEDChecker + * + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die('Restricted access'); diff --git a/administrator/components/com_jedchecker/libraries/rules/framework.ini b/administrator/components/com_jedchecker/libraries/rules/framework.ini index d70c8fc..954172f 100644 --- a/administrator/components/com_jedchecker/libraries/rules/framework.ini +++ b/administrator/components/com_jedchecker/libraries/rules/framework.ini @@ -1,18 +1,16 @@ +; @package Joomla.JEDChecker +; @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. +; @license GNU General Public License version 2 or later; see LICENSE.txt + ; This is the configuration file of the noframework rule. -; -; @author Riccardo Zorn -; @date 2014-02-22 -; @copyright Copyright (C) 2008 - 2014 fasterjoomla.com . All rights reserved. -; @license GNU General Public License version 2 or later; see LICENSE -; @site fasterjoomla.com ; A different format for this rule's params. In order to provide accurate messages, we have four main keys ; - error_groups -; - warning_groups +; - warning_groups ; - notice_groups ; - compatibility_groups ; each MUST contain the names of the sub-keys that should trigger a warning or a notice. -; In case an offending string is found in the file, a warning/notice will be raised with an error message named +; In case an offending string is found in the file, a warning/notice will be raised with an error message named ; COM_JEDCHECKER_ERROR_NOFRAMEWORK_ followed by the offending key in uppercase e.g. COM_JEDCHECKER_ERROR_NOFRAMEWORK_SUPERGLOBALS ; ; ref: docs.joomla.org/Potential_backward_compatibility_issues_in_Joomla_3.0_and_Joomla_Platform_12.1 diff --git a/administrator/components/com_jedchecker/libraries/rules/framework.php b/administrator/components/com_jedchecker/libraries/rules/framework.php index d41430f..7046748 100644 --- a/administrator/components/com_jedchecker/libraries/rules/framework.php +++ b/administrator/components/com_jedchecker/libraries/rules/framework.php @@ -1,9 +1,9 @@ - * @date 23.02.2014 - * @copyright Copyright (C) 2008 - 2014 fasterjoomla.com . All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @package Joomla.JEDChecker + * + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die('Restricted access'); diff --git a/administrator/components/com_jedchecker/libraries/rules/gpl.ini b/administrator/components/com_jedchecker/libraries/rules/gpl.ini index bfff6ef..d99915a 100644 --- a/administrator/components/com_jedchecker/libraries/rules/gpl.ini +++ b/administrator/components/com_jedchecker/libraries/rules/gpl.ini @@ -1,11 +1,10 @@ +; @package Joomla.JEDChecker +; @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. +; @license GNU General Public License version 2 or later; see LICENSE.txt + ; This is the configuration file of the GPL rule. ; ADD all compatible licenses with GPL here ; -; @author eaxs -; @date 07/06/2012 -; @copyright Copyright (C) 2008 - 2012 compojoom.com . All rights reserved. -; @license GNU General Public License version 2 or later; see LICENSE - ; The valid constants to search for constants="BSD" diff --git a/administrator/components/com_jedchecker/libraries/rules/gpl.php b/administrator/components/com_jedchecker/libraries/rules/gpl.php index 2fb7b93..fb5fd9b 100644 --- a/administrator/components/com_jedchecker/libraries/rules/gpl.php +++ b/administrator/components/com_jedchecker/libraries/rules/gpl.php @@ -1,10 +1,9 @@ - * @author Daniel Dimitrov - * @date 07/06/2012 - * @copyright Copyright (C) 2008 - 2012 compojoom.com . All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @package Joomla.JEDChecker + * + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die('Restricted access'); diff --git a/administrator/components/com_jedchecker/libraries/rules/jamss.ini b/administrator/components/com_jedchecker/libraries/rules/jamss.ini index 55e800e..6c01881 100644 --- a/administrator/components/com_jedchecker/libraries/rules/jamss.ini +++ b/administrator/components/com_jedchecker/libraries/rules/jamss.ini @@ -1,10 +1,9 @@ +; @package Joomla.JEDChecker +; @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. +; @license GNU General Public License version 2 or later; see LICENSE.txt + ; This is the configuration file of the Jamss rule. ; -; @author Riccardo Zorn -; @date 2014-02-22 -; @copyright Copyright (C) 2008 - 2014 fasterjoomla.com . All rights reserved. -; @license GNU General Public License version 2 or later; see LICENSE -; @site fasterjoomla.com ; This rule runs the JAMSS checks: https://github.com/btoplak/Joomla-Anti-Malware-Scan-Script/blob/master/jamss.php ; JAMSS description: This script should be used for searching the infected or malware/backdoor diff --git a/administrator/components/com_jedchecker/libraries/rules/jamss.php b/administrator/components/com_jedchecker/libraries/rules/jamss.php index 2644866..d8bb58b 100644 --- a/administrator/components/com_jedchecker/libraries/rules/jamss.php +++ b/administrator/components/com_jedchecker/libraries/rules/jamss.php @@ -1,10 +1,9 @@ - * @author Riccardo Zorn - * @date 24.02.2014 - * @copyright Copyright (C) 2008 - 2014 fasterjoomla.com . All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @package Joomla.JEDChecker + * + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die('Restricted access'); diff --git a/administrator/components/com_jedchecker/libraries/rules/jexec.ini b/administrator/components/com_jedchecker/libraries/rules/jexec.ini index 0b2d6eb..f069801 100644 --- a/administrator/components/com_jedchecker/libraries/rules/jexec.ini +++ b/administrator/components/com_jedchecker/libraries/rules/jexec.ini @@ -1,10 +1,9 @@ +; @package Joomla.JEDChecker +; @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. +; @license GNU General Public License version 2 or later; see LICENSE.txt + ; This is the configuration file of the JEXEC rule. ; -; @author eaxs -; @date 07/06/2012 -; @copyright Copyright (C) 2008 - 2012 compojoom.com . All rights reserved. -; @license GNU General Public License version 2 or later; see LICENSE - ; The valid constants to search for constants ="_JEXEC, JPATH_PLATFORM, JPATH_BASE, AKEEBAENGINE, WF_EDITOR" diff --git a/administrator/components/com_jedchecker/libraries/rules/jexec.php b/administrator/components/com_jedchecker/libraries/rules/jexec.php index 03cf19e..9da9d22 100644 --- a/administrator/components/com_jedchecker/libraries/rules/jexec.php +++ b/administrator/components/com_jedchecker/libraries/rules/jexec.php @@ -1,10 +1,9 @@ - * @author Daniel Dimitrov - * @date 07/06/2012 - * @copyright Copyright (C) 2008 - 2012 compojoom.com . All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @package Joomla.JEDChecker + * + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die('Restricted access'); diff --git a/administrator/components/com_jedchecker/libraries/rules/xmlinfo.php b/administrator/components/com_jedchecker/libraries/rules/xmlinfo.php index 69161f0..9a16d22 100644 --- a/administrator/components/com_jedchecker/libraries/rules/xmlinfo.php +++ b/administrator/components/com_jedchecker/libraries/rules/xmlinfo.php @@ -1,10 +1,9 @@ - * @author Daniel Dimitrov - * @date 07/06/2012 - * @copyright Copyright (C) 2008 - 2012 compojoom.com . All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @package Joomla.JEDChecker + * + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die('Restricted access'); @@ -73,6 +72,23 @@ class JedcheckerRulesXMLinfo extends JEDcheckerRule { $xml = JFactory::getXml($file); + // Get all the info about the file + $folder_info = pathinfo($file); + + // Get the folder path + $folder_path = $folder_info['dirname']; + + // Get the folder name + $folder_name = $folder_info['dirname']; + $folder_name_exploded = explode(DIRECTORY_SEPARATOR,$folder_name); + if ( is_array($folder_name_exploded) ) { + $folder_name = end($folder_name_exploded); + } + + // Load the language of the extension (if any) + $lang = JFactory::getLanguage(); + $lang->load($folder_name,$folder_path); + // Failed to parse the xml file. // Assume that this is not a extension manifest if (!$xml) @@ -87,7 +103,10 @@ class JedcheckerRulesXMLinfo extends JEDcheckerRule return true; } - $info[] = JText::sprintf('COM_JEDCHECKER_INFO_XML_NAME_XML', (string) $xml->name); + // Get the real extension's name now that the language has been loaded + (string) $extension_name = $lang->_($xml->name); + + $info[] = JText::sprintf('COM_JEDCHECKER_INFO_XML_NAME_XML', $extension_name); $info[] = JText::sprintf('COM_JEDCHECKER_INFO_XML_VERSION_XML', (string) $xml->version); $info[] = JText::sprintf('COM_JEDCHECKER_INFO_XML_CREATIONDATE_XML', (string) $xml->creationDate); $this->report->addInfo($file, implode('
', $info)); diff --git a/administrator/components/com_jedchecker/libraries/rules/xmllicense.php b/administrator/components/com_jedchecker/libraries/rules/xmllicense.php index 8abe7e8..e97a665 100644 --- a/administrator/components/com_jedchecker/libraries/rules/xmllicense.php +++ b/administrator/components/com_jedchecker/libraries/rules/xmllicense.php @@ -1,10 +1,9 @@ - * @author Daniel Dimitrov - * @date 07/06/2012 - * @copyright Copyright (C) 2008 - 2012 compojoom.com . All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @package Joomla.JEDChecker + * + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die('Restricted access'); diff --git a/administrator/components/com_jedchecker/libraries/rules/xmlupdateserver.php b/administrator/components/com_jedchecker/libraries/rules/xmlupdateserver.php index dbe17eb..6578db3 100644 --- a/administrator/components/com_jedchecker/libraries/rules/xmlupdateserver.php +++ b/administrator/components/com_jedchecker/libraries/rules/xmlupdateserver.php @@ -1,10 +1,9 @@ - * @author Daniel Dimitrov - * @date 07/06/2012 - * @copyright Copyright (C) 2008 - 2012 compojoom.com . All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @package Joomla.JEDChecker + * + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die('Restricted access'); @@ -51,7 +50,7 @@ class JedcheckerRulesXMLUpdateServer extends JEDcheckerRule { // Find all XML files of the extension $files = JFolder::files($this->basedir, '.xml$', true, true); - + // Find XML package file $packageFile = $this->checkPackageXML($files); @@ -59,10 +58,10 @@ class JedcheckerRulesXMLUpdateServer extends JEDcheckerRule { $XMLFiles = $this->findXMLPaths($files); } - + return true; } - + /** * Reads a file and searches for package xml file * @@ -71,25 +70,25 @@ class JedcheckerRulesXMLUpdateServer extends JEDcheckerRule * @return boolean True if the package xml file was found, otherwise False. */ protected function checkPackageXML($files) - { + { $packageCount = 0; - - foreach ($files as $file) + + foreach ($files as $file) { $xml = JFactory::getXml($file); // Check if this is an XML and an extension manifest if ($xml && ($xml->getName() == 'install' || $xml->getName() == 'extension')) - { + { // Check if extension attribute 'type' is for a package if($xml->attributes()->type == 'package') { $packageCount++; $this->find($file); } - } + } } - + // No XML file found for package if ($packageCount == 0) { @@ -98,7 +97,7 @@ class JedcheckerRulesXMLUpdateServer extends JEDcheckerRule return true; } } - + /** * Reads a file and searches for paths of xml files * @@ -107,11 +106,11 @@ class JedcheckerRulesXMLUpdateServer extends JEDcheckerRule * @return void */ protected function findXMLPaths($files) - { + { $XMLFiles = array(); $componentPaths = array(); - - foreach ($files as $file) + + foreach ($files as $file) { $xml = JFactory::getXml($file); @@ -125,25 +124,25 @@ class JedcheckerRulesXMLUpdateServer extends JEDcheckerRule 'directoryPath' => substr($file, 0, strrpos( $file, '/')), 'directory' => trim(end($directories)) ); - + if ($xml->attributes()->type == 'component') { $componentPaths[] = substr($file, 0, strrpos( $file, '/')); } - } + } } - + foreach ($XMLFiles as $XMLFile) { // Always check component XML files for update servers if ($XMLFile['type'] == 'component') { $this->find($XMLFile['filepath']); - + } else { // If not component, check if XML is nested inside component folder. $nested = false; - + foreach ($componentPaths as $component) { if (strpos($XMLFile['directoryPath'], $component) !== false) @@ -151,13 +150,13 @@ class JedcheckerRulesXMLUpdateServer extends JEDcheckerRule $nested = true; } } - + if (!$nested){ $this->find($XMLFile['filepath']); } } } - + return true; } @@ -172,7 +171,7 @@ class JedcheckerRulesXMLUpdateServer extends JEDcheckerRule protected function find($file) { $xml = JFactory::getXml($file); - + // Failed to parse the xml file. // Assume that this is not a extension manifest if (!$xml) @@ -194,16 +193,16 @@ class JedcheckerRulesXMLUpdateServer extends JEDcheckerRule return false; } - + // Check if server tag(s) exist if (!isset($xml->updateservers->server)) { $this->report->addError($file, JText::_('COM_JEDCHECKER_ERROR_XML_UPDATE_SERVER_NOT_FOUND')); return false; - - } - + + } + // Check if server tag(s) contain valid links foreach ($xml->updateservers->server as $server) { @@ -212,7 +211,7 @@ class JedcheckerRulesXMLUpdateServer extends JEDcheckerRule $this->report->addError($file, JText::_('COM_JEDCHECKER_ERROR_XML_UPDATE_SERVER_LINK_NOT_FOUND')); return false; - + } else { $this->report->addInfo($file, JText::sprintf('COM_JEDCHECKER_INFO_XML_UPDATE_SERVER_LINK', (string) $server)); } diff --git a/administrator/components/com_jedchecker/models/report.php b/administrator/components/com_jedchecker/models/report.php index 56b0378..4cf1d3f 100644 --- a/administrator/components/com_jedchecker/models/report.php +++ b/administrator/components/com_jedchecker/models/report.php @@ -1,10 +1,9 @@ - * @author Daniel Dimitrov - * @date 07/06/2012 - * @copyright Copyright (C) 2008 - 2012 compojoom.com . All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @package Joomla.JEDChecker + * + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die('Restricted access'); @@ -161,7 +160,7 @@ class JEDcheckerReport extends JObject public function getHTML() { $html = array(); - + if ($this->data['count']->total == 0) { // No errors or compatibility issues found @@ -180,7 +179,7 @@ class JEDcheckerReport extends JObject if ($error_count > 0) { $collapseID = uniqid('error_'); - + $html[] = '
' . $error_count . ' ' . JText::_('COM_JEDCHECKER_ERRORS') . ' - Click to View Details
'; $html[] = '
    '; @@ -213,12 +212,12 @@ class JEDcheckerReport extends JObject // Go through the compat list if ($compat_count > 0) { - + $collapseID = uniqid('warning_'); - + $html[] = '
    ' . $compat_count . ' ' . JText::_('COM_JEDCHECKER_COMPAT_ISSUES') . ' - Click to View Details
    '; $html[] = '
      '; - + foreach ($this->data['compat'] AS $i => $item) { $num = $i + 1; @@ -250,12 +249,12 @@ class JEDcheckerReport extends JObject // Go through the compat list if ($info_count > 0) { - + $collapseID = uniqid('info_'); - + $html[] = '
      ' . $info_count . ' ' . JText::_('COM_JEDCHECKER_INFO') . ' - Click to View Details
      '; $html[] = '
        '; - + foreach ($this->data['info'] AS $i => $item) { $num = $i + 1; @@ -288,10 +287,10 @@ class JEDcheckerReport extends JObject if ($warning_count > 0) { $collapseID = uniqid('warning_'); - + $html[] = '
        ' . $warning_count . ' ' . JText::_('COM_JEDCHECKER_WARNING') . ' - Click to View Details
        '; $html[] = '
          '; - + foreach ($this->data['warning'] AS $i => $item) { $num = $i + 1; diff --git a/administrator/components/com_jedchecker/models/rule.php b/administrator/components/com_jedchecker/models/rule.php index 13f25ed..ac2a8a1 100644 --- a/administrator/components/com_jedchecker/models/rule.php +++ b/administrator/components/com_jedchecker/models/rule.php @@ -1,14 +1,15 @@ - * @author Daniel Dimitrov - * @date 07/06/2012 - * @copyright Copyright (C) 2008 - 2012 compojoom.com . All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @package Joomla.JEDChecker + * + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die('Restricted access'); +use Joomla\Registry\Registry; + /** * class JEDcheckerRule @@ -107,7 +108,10 @@ class JEDcheckerRule extends JObject $file_name = str_replace('jedcheckerrules', '', strtolower(get_class($this))); $params_file = JPATH_COMPONENT_ADMINISTRATOR . '/libraries/rules/' . $file_name . '.ini'; - $params = Joomla\Registry\Registry::getInstance('jedchecker.rule.' . $file_name); + $params = new Registry('jedchecker.rule.' . $file_name); + //$params = $registry->getInstance('jedchecker.rule.' . $file_name); + + //$params = Joomla\Registry\Registry::getInstance('jedchecker.rule.' . $file_name); // Load the params from the ini file if (file_exists($params_file)) diff --git a/administrator/components/com_jedchecker/script.php b/administrator/components/com_jedchecker/script.php index 63bcdd7..a70ddde 100644 --- a/administrator/components/com_jedchecker/script.php +++ b/administrator/components/com_jedchecker/script.php @@ -1,10 +1,9 @@ - * @date 02.06.12 + * @package Joomla.JEDChecker * - * @copyright Copyright (C) 2008 - 2012 compojoom.com . All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die('Restricted access'); @@ -31,7 +30,7 @@ class Com_JedcheckerInstallerScript if (version_compare(PHP_VERSION, '5.3.10', '<')) { $this->loadLanguage(); - + Jerror::raiseWarning(null, JText::sprintf('COM_JEDCHECKER_PHP_VERSION_INCOMPATIBLE', PHP_VERSION, '5.3.10')); return false; diff --git a/administrator/components/com_jedchecker/views/uploads/tmpl/default.php b/administrator/components/com_jedchecker/views/uploads/tmpl/default.php index 6e0bbea..8896615 100644 --- a/administrator/components/com_jedchecker/views/uploads/tmpl/default.php +++ b/administrator/components/com_jedchecker/views/uploads/tmpl/default.php @@ -1,118 +1,184 @@ + + + -
          -
          -
          -
          -

          - -

          + + + + -

          - -

          +
          +
          + -

          - -

          -
            -
          1. -
          2. -
          3. -
          +
          +
          +

          +

          +

          +

          +

            +
          1. +
          2. +
          +

          +
          +
          +
          + + +
          +
          +
          +
          + +
          +
          +
          +
          - - - -
          -
          -
          -
          -
          -

          -

          - +
          -
          -
          - \ No newline at end of file diff --git a/administrator/components/com_jedchecker/views/uploads/view.html.php b/administrator/components/com_jedchecker/views/uploads/view.html.php index 30df241..b7de5f4 100644 --- a/administrator/components/com_jedchecker/views/uploads/view.html.php +++ b/administrator/components/com_jedchecker/views/uploads/view.html.php @@ -1,10 +1,9 @@ - * @date 02.06.12 + * @package Joomla.JEDChecker * - * @copyright Copyright (C) 2008 - 2012 compojoom.com . All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die('Restricted access'); @@ -27,6 +26,8 @@ class JedcheckerViewUploads extends JViewLegacy */ public function display($tpl = null) { + $this->path = JFactory::getConfig()->get('tmp_path') . '/jed_checker'; + $this->setToolbar(); $this->jsOptions['url'] = JUri::base(); $this->jsOptions['rules'] = $this->getRules(); @@ -59,20 +60,19 @@ class JedcheckerViewUploads extends JViewLegacy */ public function setToolbar() { - if ($this->filesExist('archives')) - { - JToolbarHelper::custom('uploads.unzip', 'folder', 'folder', 'unzip', false); - } - if ($this->filesExist('unzipped')) { - JToolbarHelper::custom('police.check', 'search', 'search', 'Check', false); + JToolbarHelper::custom('check', 'search', 'search', 'Check', false); } JToolbarHelper::title('JED checker'); - - if (JFactory::getUser()->authorise('core.admin', 'com_jedchecker')) - { + if ( file_exists($this->path) ) + { + JToolbarHelper::custom('uploads.clear', 'delete', 'delete', 'Clear', false); + } + + if (JFactory::getUser()->authorise('core.admin', 'com_jedchecker')) + { JToolbarHelper::preferences('com_jedchecker'); } } diff --git a/jedchecker.xml b/jedchecker.xml index d42f87c..d9173b6 100644 --- a/jedchecker.xml +++ b/jedchecker.xml @@ -1,37 +1,35 @@ - + COM_JEDCHECKER Joomla! Extensions Directory - 2017-02-14 - Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. + 2019-03-09 + Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. extensions@extensions.joomla.org https://github.com/joomla-extensions/jedchecker - 2.0 + 2.1.0 http://www.gnu.org/copyleft/gpl.html GNU/GPL - script.php + script.php COM_JEDCHECKER - - access.xml + + access.xml config.xml controller.php controllers jedchecker.php - jedchecker.xml language libraries models - script.php views - css - js + css - + + https://raw.githubusercontent.com/joomla-extensions/jedchecker/master/manifest.xml diff --git a/manifest.xml b/manifest.xml new file mode 100644 index 0000000..848d15f --- /dev/null +++ b/manifest.xml @@ -0,0 +1,16 @@ + + + + JED Checker Extension + + com_jedchecker + component + 3.6.0 + site + https://github.com/joomla-extensions/jedchecker/releases/tag/2.1.0 + + https://downloads.joomla.org/extensions/jedchecker/2.1.0/com-jedchecker-2.1.0.zip + + + + \ No newline at end of file diff --git a/media/com_jedchecker/css/j3-style.css b/media/com_jedchecker/css/j3-style.css new file mode 100644 index 0000000..7ca9cf5 --- /dev/null +++ b/media/com_jedchecker/css/j3-style.css @@ -0,0 +1,285 @@ +.col-md-8 { + flex: 0 0 66.66667%; + max-width: 66.66667%; +} + +.col-1, +.col-2, +.col-3, +.col-4, +.col-5, +.col-6, +.col-7, +.col-8, +.col-9, +.col-10, +.col-11, +.col-12, +.col, +.col-auto, +.col-sm-1, +.col-sm-2, +.col-sm-3, +.col-sm-4, +.col-sm-5, +.col-sm-6, +.col-sm-7, +.col-sm-8, +.col-sm-9, +.col-sm-10, +.col-sm-11, +.col-sm-12, +.col-sm, +.col-sm-auto, +.col-md-1, +.col-md-2, +.col-md-3, +.col-md-4, +.col-md-5, +.col-md-6, +.col-md-7, +.col-md-8, +.col-md-9, +.col-md-10, +.col-md-11, +.col-md-12, +.col-md, +.col-md-auto, +.col-lg-1, +.col-lg-2, +.col-lg-3, +.col-lg-4, +.col-lg-5, +.col-lg-6, +.col-lg-7, +.col-lg-8, +.col-lg-9, +.col-lg-10, +.col-lg-11, +.col-lg-12, +.col-lg, +.col-lg-auto, +.col-xl-1, +.col-xl-2, +.col-xl-3, +.col-xl-4, +.col-xl-5, +.col-xl-6, +.col-xl-7, +.col-xl-8, +.col-xl-9, +.col-xl-10, +.col-xl-11, +.col-xl-12, +.col-xl, +.col-xl-auto { + position: relative; + width: 100%; + min-height: 1px; + padding-right: 7.5px; + padding-left: 7.5px; +} + +.mb-3, +.my-3 { + margin-bottom: 1rem !important; +} + +.col-md-6 { + flex: 0 0 50%; + max-width: 50%; +} + +.col-md-4 { + flex: 0 0 33.33333%; + max-width: 31.33333%; +} + +.bg-light { + background-color: #f8f9fa !important; +} + +.card { + position: relative; + display: flex; + flex-direction: column; + min-width: 0; + word-wrap: break-word; + background-color: transparent; + background-clip: border-box; + border: 1px solid #ccc; + border-radius: .25rem; +} + +.row { + display: flex; + flex-wrap: wrap; + margin-right: -7.5px; + margin-left: -7.5px; +} + +.card-body { + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); + flex: 1 1 auto; + padding: 1.25rem; +} + +.card-footer { + padding: .75rem 1.25rem; + background-color: transparent; + border-top: 0 solid transparent; +} + +p { + margin-top: 0; + margin-bottom: 1rem; +} + +ol, +ul, +dl { + margin-top: 0; + margin-bottom: 1rem; +} + +.form-row { + display: flex; + margin-right: -5px; + margin-left: -5px; +} + +.form-row>.col, +.form-row>[class*="col-"] { + padding-right: 5px; + padding-left: 5px; +} + +.custom-file { + position: relative; + display: inline-block; + width: 100%; + height: calc(2.7rem + 2px); + margin-bottom: 0; +} + +.custom-file-input { + position: relative; + z-index: 2; + width: 100%; + height: calc(2.7rem + 2px); + margin: 0; + opacity: 0; +} + +.custom-file-label { + position: absolute; + top: 0; + right: 0; + left: 0; + z-index: 1; + padding: .6rem 1rem; + line-height: 1.5; + color: #495057; + background-color: #fff; + border: .25rem; +} + +.invalid-feedback { + display: none; + width: 100%; + margin-top: .25rem; + font-size: 80%; + color: #c52827; +} + +.btn:not(:disabled):not(.disabled) { + cursor: pointer; +} + +.btn-success { + color: #fff; + background-color: #2f7d32; + border-color: #2f7d32; +} + +.btn { + font-weight: 400; + text-align: center; + white-space: nowrap; + vertical-align: middle; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + padding: .6rem 1rem; + line-height: 1.5; + transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out; +} + +.btn { + white-space: normal !important; +} + +button, +html [type="button"], +[type="reset"], +[type="submit"] { + -webkit-appearance: button; +} + +button, +select { + text-transform: none; +} + +button, +input { + overflow: visible; +} + +input, +button, +select, +optgroup, +textarea { + margin: 0; + font-family: inherit; + font-size: inherit; + line-height: inherit; +} + +button { + border-radius: 0; +} + +.text-white { + color: #fff !important; +} + +.bg-info { + background-color: #17a2b8 !important; +} + +.card-header { + padding: .75rem 1.25rem; + margin-bottom: 0; + /*background-color: transparent;*/ + background-color: rgba(0, 0, 0, .03); + border-bottom: 1px solid #ccc; +} + +.custom-file-label::after { + position: absolute; + top: 0; + right: 0; + bottom: 0; + z-index: 3; + display: block; + padding: .6rem 1rem; + line-height: 1.5; + color: white; + content: "Browse"; + background-color: #3073bb; + border-left: 1px solid #ced4da; + border-radius: 0 .25rem .25rem 0; +} \ No newline at end of file diff --git a/media/com_jedchecker/css/j3-style.min.css b/media/com_jedchecker/css/j3-style.min.css new file mode 100644 index 0000000..1cdff75 --- /dev/null +++ b/media/com_jedchecker/css/j3-style.min.css @@ -0,0 +1 @@ +.col-md-8{flex:0 0 66.66667%;max-width:66.66667%}.col,.col-1,.col-10,.col-11,.col-12,.col-2,.col-3,.col-4,.col-5,.col-6,.col-7,.col-8,.col-9,.col-auto,.col-lg,.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-auto,.col-md,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-auto,.col-sm,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-auto,.col-xl,.col-xl-1,.col-xl-10,.col-xl-11,.col-xl-12,.col-xl-2,.col-xl-3,.col-xl-4,.col-xl-5,.col-xl-6,.col-xl-7,.col-xl-8,.col-xl-9,.col-xl-auto{position:relative;width:100%;min-height:1px;padding-right:7.5px;padding-left:7.5px}.mb-3,.my-3{margin-bottom:1rem!important}.col-md-6{flex:0 0 50%;max-width:50%}.col-md-4{flex:0 0 33.33333%;max-width:31.33333%}.bg-light{background-color:#f8f9fa!important}.card{position:relative;display:flex;flex-direction:column;min-width:0;word-wrap:break-word;background-color:transparent;background-clip:border-box;border:1px solid #ccc;border-radius:.25rem}.row{display:flex;flex-wrap:wrap;margin-right:-7.5px;margin-left:-7.5px}.card-body{box-shadow:0 1px 2px rgba(0,0,0,.25);flex:1 1 auto;padding:1.25rem}.card-footer{padding:.75rem 1.25rem;background-color:transparent;border-top:0 solid transparent}p{margin-top:0;margin-bottom:1rem}dl,ol,ul{margin-top:0;margin-bottom:1rem}.form-row{display:flex;margin-right:-5px;margin-left:-5px}.form-row>.col,.form-row>[class*=col-]{padding-right:5px;padding-left:5px}.custom-file{position:relative;display:inline-block;width:100%;height:calc(2.7rem + 2px);margin-bottom:0}.custom-file-input{position:relative;z-index:2;width:100%;height:calc(2.7rem + 2px);margin:0;opacity:0}.custom-file-label{position:absolute;top:0;right:0;left:0;z-index:1;padding:.6rem 1rem;line-height:1.5;color:#495057;background-color:#fff;border:.25rem}.invalid-feedback{display:none;width:100%;margin-top:.25rem;font-size:80%;color:#c52827}.btn:not(:disabled):not(.disabled){cursor:pointer}.btn-success{color:#fff;background-color:#2f7d32;border-color:#2f7d32}.btn{font-weight:400;text-align:center;white-space:nowrap;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;padding:.6rem 1rem;line-height:1.5;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}.btn{white-space:normal!important}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}button,select{text-transform:none}button,input{overflow:visible}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button{border-radius:0}.text-white{color:#fff!important}.bg-info{background-color:#17a2b8!important}.card-header{padding:.75rem 1.25rem;margin-bottom:0;background-color:rgba(0,0,0,.03);border-bottom:1px solid #ccc}.custom-file-label::after{position:absolute;top:0;right:0;bottom:0;z-index:3;display:block;padding:.6rem 1rem;line-height:1.5;color:#fff;content:"Browse";background-color:#3073bb;border-left:1px solid #ced4da;border-radius:0 .25rem .25rem 0} \ No newline at end of file diff --git a/media/com_jedchecker/css/css.css b/media/com_jedchecker/css/style.css similarity index 60% rename from media/com_jedchecker/css/css.css rename to media/com_jedchecker/css/style.css index e9e63da..d4e126e 100644 --- a/media/com_jedchecker/css/css.css +++ b/media/com_jedchecker/css/style.css @@ -1,12 +1,12 @@ #adminForm { - background: #FFF; + background: #FFF; } #police-check-result { padding: 0; } -#police-check-result > div { +#police-check-result>div { border-top: 1px solid #ccc; padding: 5px 10px; } @@ -16,25 +16,27 @@ } .copyright { - line-height: 160%; - margin: 10px; - text-align: center; + line-height: 160%; + margin: 10px; + text-align: center; } .rule { - font-weight: bold; + font-weight: bold; } small { font-size: 110%; - padding: 0 0 0 30px; - white-space: nowrap; + padding: 0 0 0 30px; + white-space: nowrap; } + #police-check-result li { - margin-bottom:0.7em; - overflow:hidden; + margin-bottom: 0.7em; + overflow: hidden; } + #police-check-result ul li pre { background: white none repeat scroll 0 0; border: 1px solid #ccc; @@ -48,10 +50,15 @@ small { } .jamss_tooltip { - background-color:blue; - color:white; - border-radius:20px; + background-color: blue; + color: white; + border-radius: 20px; } + .jamss_tooltip.code { - background-color:#C03020; + background-color: #C03020; } + +.btn { + white-space: normal !important; +} \ No newline at end of file diff --git a/media/com_jedchecker/css/style.min.css b/media/com_jedchecker/css/style.min.css new file mode 100644 index 0000000..1e3d09d --- /dev/null +++ b/media/com_jedchecker/css/style.min.css @@ -0,0 +1 @@ +#adminForm{background:#fff}#police-check-result{padding:0}#police-check-result>div{border-top:1px solid #ccc;padding:5px 10px}#police-check-result .alert{margin:5px 0}.copyright{line-height:160%;margin:10px;text-align:center}.rule{font-weight:700}small{font-size:110%;padding:0 0 0 30px;white-space:nowrap}#police-check-result li{margin-bottom:.7em;overflow:hidden}#police-check-result ul li pre{background:#fff none repeat scroll 0 0;border:1px solid #ccc;display:block;margin:0;overflow:hidden;padding:2px 6px;text-overflow:ellipsis;vertical-align:middle;white-space:nowrap}.jamss_tooltip{background-color:#00f;color:#fff;border-radius:20px}.jamss_tooltip.code{background-color:#c03020}.btn{white-space:normal!important} \ No newline at end of file diff --git a/media/com_jedchecker/js/police.js b/media/com_jedchecker/js/police.js index b3fd6f8..811b2bb 100644 --- a/media/com_jedchecker/js/police.js +++ b/media/com_jedchecker/js/police.js @@ -1,36 +1,35 @@ /** - * @author Daniel Dimitrov - compojoom.com - * @date: 09.06.12 + * @package Joomla.JEDChecker * - * @copyright Copyright (C) 2008 - 2012 compojoom.com . All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt */ var police = new Class({ - Implements:[Options], - options:{}, - initialize:function (options) { + Implements: [Options], + options: {}, + initialize: function (options) { var self = this; this.setOptions(options); // Clear result from any previous check - if(document.id('police-check-result').getChildren('div').length > 0) { + if (document.id('police-check-result').getChildren('div').length > 0) { document.id('police-check-result').empty(); } - - this.options.rules.each(function(rule){ - self.check(rule); + + this.options.rules.each(function (rule) { + self.check(rule); }); new Fx.Scroll(window).toElement(document.id('police-check-result')); }, - check: function(rule) { + check: function (rule) { var self = this; new Request({ - url: self.options.url + '/index.php?option=com_jedchecker&task=police.check&format=raw&rule='+rule, + url: self.options.url + '/index.php?option=com_jedchecker&task=police.check&format=raw&rule=' + rule, async: false, - onComplete: function(result) { + onComplete: function (result) { var div = new Element('div', { html: result }); diff --git a/media/com_jedchecker/js/police.min.js b/media/com_jedchecker/js/police.min.js new file mode 100644 index 0000000..a9c9ff5 --- /dev/null +++ b/media/com_jedchecker/js/police.min.js @@ -0,0 +1 @@ +var police=new Class({Implements:[Options],options:{},initialize:function(e){var t=this;this.setOptions(e),0 - * @date 02.06.12 + * @package Joomla.JEDChecker * - * @copyright Copyright (C) 2008 - 2012 compojoom.com . All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die('Restricted access'); @@ -27,15 +26,6 @@ class Com_JedcheckerInstallerScript public function preflight($type, $parent) { $this->parent = $parent; - - if (version_compare(PHP_VERSION, '5.3.10', '<')) - { - $this->loadLanguage(); - - Jerror::raiseWarning(null, JText::sprintf('COM_JEDCHECKER_PHP_VERSION_INCOMPATIBLE', PHP_VERSION, '5.3.10')); - - return false; - } } /**