31
2
mirror of https://github.com/joomla-extensions/jedchecker.git synced 2024-06-08 00:10:47 +00:00

Merge remote-tracking branch 'refs/remotes/origin/master' into pr/32

# Conflicts:

#	source/administrator/components/com_jedchecker/language/en-GB/en-GB.com_jedchecker.ini
#	source/administrator/components/com_jedchecker/script.php
This commit is contained in:
Jaz Parkyn 2016-10-03 23:20:07 +01:00
commit 61842f492f
13 changed files with 222 additions and 223 deletions

View File

@ -1,19 +1,19 @@
<?php
/**
* @author Daniel Dimitrov <daniel@compojoom.com>
* @date 26.10.15
*
* @copyright Copyright (C) 2008 - 2015 compojoom.com . All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
defined('_JEXEC') or die ('Restricted access');
/**
* Class JedcheckerController
*
* @since 1.0
*/
class JedcheckerController extends JControllerlegacy
{
}
<?php
/**
* @author Daniel Dimitrov <daniel@compojoom.com>
* @date 26.10.15
*
* @copyright Copyright (C) 2008 - 2015 compojoom.com . All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
defined('_JEXEC') or die ('Restricted access');
/**
* Class JedcheckerController
*
* @since 1.0
*/
class JedcheckerController extends JControllerLegacy
{
}

View File

@ -1,143 +1,143 @@
<?php
/**
* @author Daniel Dimitrov <daniel@compojoom.com>
* @date 26.10.15
*
* @copyright Copyright (C) 2008 - 2015 compojoom.com . All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
defined('_JEXEC') or die('Restricted access');
jimport('joomla.filesystem');
jimport('joomla.filesystem.folder');
jimport('joomla.filesystem.archive');
/**
* Class jedcheckerControllerPolice
*
* @since 1.0
*/
class JedcheckerControllerPolice extends JControllerlegacy
{
/**
* Runs all the rules on the given directory
*
* @return bool
*/
public function check()
{
$rule = JRequest::getString('rule');
JLoader::discover('jedcheckerRules', JPATH_COMPONENT_ADMINISTRATOR . '/libraries/rules/');
$path = JFactory::getConfig()->get('tmp_path') . '/jed_checker/unzipped';
$class = 'jedcheckerRules' . ucfirst($rule);
// Stop if the class does not exist
if (!class_exists($class))
{
return false;
}
// Loop through each folder and police it
$folders = $this->getFolders();
foreach ($folders as $folder)
{
$this->police($class, $folder);
}
return true;
}
/**
* Run each rule and echo the result
*
* @param string $class - the class anme
* @param string $folder - the folder where the component is located
*
* @return void
*/
protected function police($class, $folder)
{
// Prepare rule properties
$properties = array('basedir' => $folder);
// Create instance of the rule
$police = new $class($properties);
// Perform check
$police->check();
// Get the report and then print it
$report = $police->get('report');
echo '<span class="rule">'
. JText::_('COM_JEDCHECKER_RULE') . ' ' . JText::_($police->get('id'))
. ' - ' . JText::_($police->get('title'))
. '</span><br/>'
. $report->getHTML();
flush();
ob_flush();
}
/**
* Get the folders that should be checked
*
* @return array
*/
protected function getFolders()
{
$folders = array();
// Add the folders in the "jed_checked/unzipped" folder
$path = JFactory::getConfig()->get('tmp_path') . '/jed_checker/unzipped';
$tmp_folders = JFolder::folders($path);
if (!empty($tmp_folders))
{
foreach ($tmp_folders as $tmp_folder)
{
$folders[] = $path . '/' . $tmp_folder;
}
}
// Parse the local.txt file and parse it
$local = JFactory::getConfig()->get('tmp_path') . '/jed_checker/local.txt';
if (JFile::exists($local))
{
$content = JFile::read($local);
if (!empty($content))
{
$lines = explode("\n", $content);
if (!empty($lines))
{
foreach ($lines as $line)
{
$line = trim($line);
if (!empty($line))
{
if (JFolder::exists(JPATH_ROOT . '/' . $line))
{
$folders[] = JPATH_ROOT . '/' . $line;
}
elseif (JFolder::exists($line))
{
$folders[] = $line;
}
}
}
}
}
}
return $folders;
}
}
<?php
/**
* @author Daniel Dimitrov <daniel@compojoom.com>
* @date 26.10.15
*
* @copyright Copyright (C) 2008 - 2015 compojoom.com . All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
defined('_JEXEC') or die('Restricted access');
jimport('joomla.filesystem');
jimport('joomla.filesystem.folder');
jimport('joomla.filesystem.archive');
/**
* Class jedcheckerControllerPolice
*
* @since 1.0
*/
class JedcheckerControllerPolice extends JControllerLegacy
{
/**
* Runs all the rules on the given directory
*
* @return bool
*/
public function check()
{
$rule = JRequest::getString('rule');
JLoader::discover('jedcheckerRules', JPATH_COMPONENT_ADMINISTRATOR . '/libraries/rules/');
$path = JFactory::getConfig()->get('tmp_path') . '/jed_checker/unzipped';
$class = 'jedcheckerRules' . ucfirst($rule);
// Stop if the class does not exist
if (!class_exists($class))
{
return false;
}
// Loop through each folder and police it
$folders = $this->getFolders();
foreach ($folders as $folder)
{
$this->police($class, $folder);
}
return true;
}
/**
* Run each rule and echo the result
*
* @param string $class - the class anme
* @param string $folder - the folder where the component is located
*
* @return void
*/
protected function police($class, $folder)
{
// Prepare rule properties
$properties = array('basedir' => $folder);
// Create instance of the rule
$police = new $class($properties);
// Perform check
$police->check();
// Get the report and then print it
$report = $police->get('report');
echo '<span class="rule">'
. JText::_('COM_JEDCHECKER_RULE') . ' ' . JText::_($police->get('id'))
. ' - ' . JText::_($police->get('title'))
. '</span><br/>'
. $report->getHTML();
flush();
ob_flush();
}
/**
* Get the folders that should be checked
*
* @return array
*/
protected function getFolders()
{
$folders = array();
// Add the folders in the "jed_checked/unzipped" folder
$path = JFactory::getConfig()->get('tmp_path') . '/jed_checker/unzipped';
$tmp_folders = JFolder::folders($path);
if (!empty($tmp_folders))
{
foreach ($tmp_folders as $tmp_folder)
{
$folders[] = $path . '/' . $tmp_folder;
}
}
// Parse the local.txt file and parse it
$local = JFactory::getConfig()->get('tmp_path') . '/jed_checker/local.txt';
if (JFile::exists($local))
{
$content = JFile::read($local);
if (!empty($content))
{
$lines = explode("\n", $content);
if (!empty($lines))
{
foreach ($lines as $line)
{
$line = trim($line);
if (!empty($line))
{
if (JFolder::exists(JPATH_ROOT . '/' . $line))
{
$folders[] = JPATH_ROOT . '/' . $line;
}
elseif (JFolder::exists($line))
{
$folders[] = $line;
}
}
}
}
}
}
return $folders;
}
}

View File

@ -18,7 +18,7 @@ jimport('joomla.filesystem.archive');
*
* @since 1.0
*/
class JedcheckerControllerUploads extends JControllerlegacy
class JedcheckerControllerUploads extends JControllerLegacy
{
/**
* Constructor.

View File

@ -1,27 +1,27 @@
; Language files have to start with semicolon (;) otherwise we have problems with transifex
COM_JEDCHECKER_CONFIGURATION="JEDchecker Configuration"
COM_JEDCHECKER_CONFIGURATION="JED Checker Configuration"
COM_JEDCHECKER_UPLOAD_FILE="Upload File"
COM_JEDCHECKER_UPLOAD_WAS_SUCCESSFUL="Upload was successful, next click the unzip button."
COM_JEDCHECKER_UPLOAD_WAS_SUCCESSFUL="Upload was successful, next click the Unzip button."
COM_JEDCHECKER_ERROR_UNABLE_TO_UPLOAD_FILE="Upload has failed, ensure that the temporary directory is writable."
COM_JEDCHECKER_UNZIP_SUCCESS="Unzip was successful, next click the check button."
COM_JEDCHECKER_UNZIP_SUCCESS="Unzip was successful, next click the Check button."
COM_JEDCHECKER_UNZIP_FAILED="Unzip failed"
COM_JEDCHECKER_RESULTS="JED Checker Results"
COM_JEDCHECKER_CONGRATS="Congratulations! If you use this component then you've most probably developed a Joomla!® extension! Now comes the &quot;hard&quot; part - getting it listed in the Joomla Extension Directory (JED). The JED has strict requirements to the extensions that get listed there. Those requirements can be found <a href='%s' target='_blank'>here</a>. This component is an attempt to simplify your and the JED editors life's by automatically checking the code for common errors in extensions."
COM_JEDCHECKER_CODE_STANDARDS="However our goal is not only to test the extensions against common code errors that prevent it from getting listed in the JED. Our goal is to also have code standards checks such as 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 <a href='%s' target='_blank'>github project page</a>. 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_CONGRATS="Congratulations! If you use this component then you've most probably developed a Joomla! extension. Now comes the &quot;hard&quot; part - getting it listed in the Joomla Extension Directory (JED). The JED has strict requirements that must be complied with before an extension will be published in the directory. Those requirements can be found <a href='%s' target='_blank'>here</a>. This component has been built with the aim of simplifying the development process by automatically checking the code for common errors in extensions."
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 <a href='%s' target='_blank'>Github project page</a>. 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_WALL_OF_HONOR="Wall of honor"
COM_JEDCHECKER_STEP2="Click on Unzip"
COM_JEDCHECKER_STEP3="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_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="Congrats! Everything seems to be fine with that rule!"
COM_JEDCHECKER_DEVELOPED_BY="JEDchecker is primary developed by <a href='%s'>compojoom.com</a>"
COM_JEDCHECKER_PHP_VERSION_INCOMPATIBLE="JEDchecker 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_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 <a href='%s'>compojoom.com</a>"
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."
COM_JEDCHECKER_ERROR_XML_LICENSE_NOT_FOUND="No license tag was found in this XML file."
@ -30,16 +30,16 @@ COM_JEDCHECKER_RULE="Rule"
COM_JEDCHECKER_ERRORS="Errors"
COM_JEDCHECKER_COMPAT_ISSUES="Compatibility Issues"
COM_JEDCHECKER_IN_LINE="in line"
COM_JEDCHECKER_ERROR_ENCODING="You've used encoding in this file. This is not an error, but an editor will have to review this file!"
COM_JEDCHECKER_ERROR_ENCODING="You've used encoding in this file. This is not an error, but a JED editor will have to review this file."
COM_JEDCHECKER_RULE_ENCODING="Base64 or other type of encoding in the files"
COM_JEDCHECKER_RULE_ENCODING_DESC="As developers we are fully aware that the base64 and similar functions have a valid place in extensions (such as URL redirects or data storage). However if you use those to make it harder for users to read your code or to mask backlinks the JED might not accept your listing submission (this is not in the spirit of GPL anyway!). An editor will review your code and determine if the way you use the base64 matches the rules of the JED. This might slow your listing review time. So the rule of thumb is - don't do fishy stuff and avoid encoding your code if possible!"
COM_JEDCHECKER_RULE_ENCODING_DESC="As developers we are fully aware that the base64 and similar functions have a valid place in extensions (such as URL redirects or data storage). However if you use those to make it harder for users to read your code or to mask backlinks the JED will not accept your listing submission (this is not in the spirit of GPL anyway!). An editor will review your code and determine if the way you use the base64 matches the rules of the JED. This might slow your listing review time. So the rule of thumb is - don't do fishy stuff and avoid encoding your code if possible!"
COM_JEDCHECKER_ERROR_ERRORREPORTING="You've used error_reporting(0) in this file."
COM_JEDCHECKER_RULE_ERRORREPORTING="error_reporting(0) in the files"
COM_JEDCHECKER_RULE_ERRORREPORTING_DESC="Use of error_reporting(0) is discouraged as Joomla provides an error_reporting option in the Global Configuration."
COM_JEDCHECKER_LEAVE_A_REVIEW_JED="If you use this component, please post a rating and a review at the <a href='%s' title='JED' target='_blank'>Joomla! Extensions Directory</a>."
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 go through the xml files and grab the value for the name tag. Useful information for the &quot;filename and install as&quot; fields in the jed submission form"
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 &quot;filename and install as&quot; fields in the jed submission form"
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"
@ -53,20 +53,20 @@ COM_JEDCHECKER_OLD_RULE_X_INI_FILE_NOT_REMOVED="'ini' file for '%s' rule could n
COM_JEDCHECKER_OLD_RULE_X_PHP_FILE_NOT_REMOVED="PHP file for '%s' rule could not be removed, manual removal recommended."
COM_JEDCHECKER_OLD_RULE_X_PHP_FILE_REMOVED="Removed PHP file for '%s' rule."
COM_JEDCHECKER_OLD_RULE_X_INI_FILE_REMOVED="Removed 'ini' file for '%s' rule."
COM_JEDCHECKER_RULE_FRAMEWORK="Joomla framework deprecated and unsafe"
COM_JEDCHECKER_RULE_FRAMEWORK="Joomla Framework deprecated and unsafe"
COM_JEDCHECKER_RULE_FRAMEWORK_DESC="Warns about <ul><li>superglobals</li><li>commonly used but deprecated functions</li><li>highly unsafe functions</li></ul>Find more info <a href='http://docs.joomla.org/Potential_backward_compatibility_issues_in_Joomla_3.0_and_Joomla_Platform_12.1' target='_blank'>on Joomla backward compatibility for Joomla 3</a>"
COM_JEDCHECKER_ERROR_FRAMEWORK_SUPERGLOBALS="Use of superglobals is strongly discouraged"
COM_JEDCHECKER_ERROR_FRAMEWORK_DIRECTDB="Use of direct db access is strongly discouraged"
COM_JEDCHECKER_RULE_FRAMEWORK_NOTINJ3="Functions removed from Joomla 3"
COM_JEDCHECKER_ERROR_FRAMEWORK_NOTINJ3="not in Joomla 3"
COM_JEDCHECKER_ERROR_FRAMEWORK_DS="DS not in Joomla 3"
COM_JEDCHECKER_ERROR_FRAMEWORK_JERR="JError is deprecated, you should use application->enqueueMessages()"
COM_JEDCHECKER_ERROR_FRAMEWORK_DIRECTDB="Use of direct database access is strongly discouraged"
COM_JEDCHECKER_RULE_FRAMEWORK_NOTINJ3="Functions deprecated in Joomla 3"
COM_JEDCHECKER_ERROR_FRAMEWORK_NOTINJ3="deprecated in Joomla 3"
COM_JEDCHECKER_ERROR_FRAMEWORK_DS="DS is deprecated in Joomla 3"
COM_JEDCHECKER_ERROR_FRAMEWORK_JERR="JError is deprecated, you should use JFactory::getApplication()->enqueueMessage();"
COM_JEDCHECKER_ERROR_FRAMEWORK_ERRORLOG="error_log and var_dump"
COM_JEDCHECKER_ERROR_FRAMEWORK_DEPRECATED="JRequest is deprecated and behaves funny with cache"
COM_JEDCHECKER_ERROR_FRAMEWORK_TODO="Are we procrastinating?"
COM_JEDCHECKER_ERROR_FRAMEWORK_GIT="Leftover code-versioning folders"
COM_JEDCHECKER_ERROR_FRAMEWORK_DEPRECATED="JRequest is deprecated, you should use JFactory::getApplication()->input;"
COM_JEDCHECKER_ERROR_FRAMEWORK_TODO="TODO statement detected"
COM_JEDCHECKER_ERROR_FRAMEWORK_GIT="Code-versioning folders detected"
COM_JEDCHECKER_RULE_JAMSS="JAMSS - Joomla! Anti-Malware Scan Script"
COM_JEDCHECKER_RULE_JAMSS_DESC="Jamss will raise many flags for use of potentially dangerous methods, additionally checking for some known attack signatures. Find out more on the <a href='https://github.com/btoplak/Joomla-Anti-Malware-Scan-Script' target='_blank'>Project's homepage</a><br>JAMSS output is very verbose and very useful, hover over any lines to see the details!"
COM_JEDCHECKER_RULE_JAMSS_DESC="JAMSS will raise many flags for use of potentially dangerous methods, additionally checking for some known attack signatures. Find out more on the <a href='https://github.com/btoplak/Joomla-Anti-Malware-Scan-Script' target='_blank'>Project's homepage</a><br>JAMSS output is very verbose and very useful, hover over any lines to see the details."
COM_JEDCHECKER_ERROR_JAMSS_SUSPICIOUS_FILENAME="Suspicious filename found :"
COM_JEDCHECKER_ERROR_JAMSS_CANNOT_OPEN="Could not check"
COM_JEDCHECKER_ERROR_JAMSS_PATTERN="Pattern found"

View File

@ -1,2 +1,2 @@
; Language files have to start with semicolon (;) otherwise we have problems with transifex
COM_JEDCHECKER="JEDchecker"
COM_JEDCHECKER="JED Checker"

View File

@ -70,7 +70,7 @@ class JedcheckerRulesFramework extends JEDcheckerRule
/**
* Check if the given resourse is part
*
* @param unknown_type $file The file name to test
* @param string $file The file name to test
*
* @return boolean
*/
@ -95,7 +95,7 @@ class JedcheckerRulesFramework extends JEDcheckerRule
/**
* reads a file and searches for any function defined in the params
*
* @param unknown_type $file The file object
* @param string $file The file name
*
* @return boolean True if the statement was found, otherwise False.
*/
@ -118,9 +118,9 @@ class JedcheckerRulesFramework extends JEDcheckerRule
/**
* runs tests and reports to the appropriate function if strings match.
*
* @param unknown_type $file The file object
* @param unknown_type $content The file content
* @param unknown_type $testObject The test object generated by getTests()
* @param string $file The file name
* @param array $content The file content
* @param object $testObject The test object generated by getTests()
*
* @return boolean
*/

View File

@ -67,7 +67,7 @@ class JedcheckerRulesJamss extends JEDcheckerRule
/**
* reads a file and searches for any function defined in the params
*
* @param unknown_type $file The file object
* @param string $file The file name
*
* @return boolean True if the statement was found, otherwise False.
*/
@ -86,9 +86,9 @@ class JedcheckerRulesJamss extends JEDcheckerRule
* In order to make this easy to update, no syntax changes are applied. Just store the variables in the object
* for faster use.
*
* @param unknown_type $deepscan Join the $jamssDeepSearchStrings
* @param bool $deepscan Merge the $jamssDeepSearchStrings
*
* @return nothing
* @return void
*/
private function init_jamss($deepscan = true)
{
@ -269,7 +269,7 @@ class JedcheckerRulesJamss extends JEDcheckerRule
*
* @param string $path path of the scanned file
*
* @return nothing
* @return bool
*/
private function scan_file($path)
{
@ -391,7 +391,7 @@ class JedcheckerRulesJamss extends JEDcheckerRule
* Calculates the line number where pattern match was found
*
* @param int $offset The offset position of found pattern match
* @param str $file_content The file content in string format
* @param string $file_content The file content in string format
*
* @return int Returns line number where the subject code was found
*/
@ -408,13 +408,13 @@ class JedcheckerRulesJamss extends JEDcheckerRule
* Raise a warning and format it properly.
* jamss warnings are very helpful but very verbose; hence we chose to use of tooltips
*
* @param unknown_type $path The file name
* @param unknown_type $title The comment's title
* @param unknown_type $info The additional info on the error
* @param unknown_type $code The affected portion of the code
* @param unknown_type $line The line number of the first match
* @param string $path The file name
* @param string $title The comment's title
* @param mixed $info The additional info on the error
* @param string $code The affected portion of the code
* @param int $line The line number of the first match
*
* @return unknown_type Returns nothing
* @return void Returns nothing
*/
private function jamssWarning($path, $title, $info, $code, $line)
{

View File

@ -71,7 +71,7 @@ class JedcheckerRulesXMLinfo extends JEDcheckerRule
*/
protected function find($file)
{
$xml = JFactory::getXML($file);
$xml = JFactory::getXml($file);
// Failed to parse the xml file.
// Assume that this is not a extension manifest

View File

@ -69,7 +69,7 @@ class JedcheckerRulesXMLlicense extends JEDcheckerRule
*/
protected function find($file)
{
$xml = JFactory::getXML($file);
$xml = JFactory::getXml($file);
// Failed to parse the xml file.
// Assume that this is not a extension manifest

View File

@ -99,7 +99,7 @@ class JEDcheckerRule extends JObject
/**
* Attempts to load a .ini param file of this rule.
*
* @return JRegistry
* @return Joomla\Registry\Registry
*/
protected function loadParams()
{
@ -107,7 +107,7 @@ class JEDcheckerRule extends JObject
$file_name = str_replace('jedcheckerrules', '', strtolower(get_class($this)));
$params_file = JPATH_COMPONENT_ADMINISTRATOR . '/libraries/rules/' . $file_name . '.ini';
$params = JRegistry::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))

View File

@ -28,13 +28,13 @@ class Com_JedcheckerInstallerScript
{
$this->parent = $parent;
if (version_compare(PHP_VERSION, '5.3.1', '<'))
if (version_compare(PHP_VERSION, '5.3.10', '<'))
{
$this->loadLanguage();
// Enqueue the error message
JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_JEDCHECKER_PHP_VERSION_INCOMPATIBLE', PHP_VERSION, '5.3.6'), 'error');
// Stop the execution and return to the installer page
JFactory::getApplication()->redirect(JRoute::_('index.php?option=com_installer', false));
Jerror::raiseWarning(null, JText::sprintf('COM_JEDCHECKER_PHP_VERSION_INCOMPATIBLE', PHP_VERSION, '5.3.10'));
return false;
}
}

View File

@ -9,7 +9,7 @@
defined('_JEXEC') or die('Restricted access');
JHTML::_('behavior.framework', true);
JHtml::_('behavior.framework', true);
JHtml::_('behavior.formvalidation');
JHtml::_('behavior.keepalive');
JHtml::stylesheet('media/com_jedchecker/css/css.css');
@ -53,7 +53,7 @@ JHtml::script('media/com_jedchecker/js/police.js');
<span class="icon-upload "></span> <?php echo JText::_('JSUBMIT'); ?>
</button>
<input type="hidden" name="task" value=""/>
<?php echo JHTML::_('form.token'); ?>
<?php echo JHtml::_('form.token'); ?>
</fieldset>
</form>
</div>
@ -99,9 +99,8 @@ JHtml::script('media/com_jedchecker/js/police.js');
<span class="rule">
<?php echo JText::_('COM_JEDCHECKER_RULE') . ' ' . $rule->get('id') . ' - ' . JText::_($rule->get('title'));?>
</span>
<p><?php echo JText::_($rule->get('description')); ?></p>
</p>
<p><?php echo JText::_($rule->get('description')); ?></p>
</li>
<?php
}

View File

@ -28,7 +28,7 @@ class JedcheckerViewUploads extends JViewLegacy
public function display($tpl = null)
{
$this->setToolbar();
$this->jsOptions['url'] = JURI::base();
$this->jsOptions['url'] = JUri::base();
$this->jsOptions['rules'] = $this->getRules();
parent::display($tpl);
}
@ -61,19 +61,19 @@ class JedcheckerViewUploads extends JViewLegacy
{
if ($this->filesExist('archives'))
{
JToolBarHelper::custom('uploads.unzip', 'folder', 'folder', 'unzip', false);
JToolbarHelper::custom('uploads.unzip', 'folder', 'folder', 'unzip', false);
}
if ($this->filesExist('unzipped'))
{
JToolBarHelper::custom('police.check', 'search', 'search', 'Check', false);
JToolbarHelper::custom('police.check', 'search', 'search', 'Check', false);
}
JToolBarHelper::title('JED checker');
JToolbarHelper::title('JED checker');
if (JFactory::getUser()->authorise('core.admin', 'com_jedchecker'))
{
JToolBarHelper::preferences('com_jedchecker');
JToolbarHelper::preferences('com_jedchecker');
}
}