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 655f058..a8717ec 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 @@ -49,7 +49,7 @@ COM_JEDCHECKER_INFO_XML_NAME_RESERVED_KEYWORDS="Keywords such as module, plugin COM_JEDCHECKER_INFO_XML_NAME_VERSION="Version in name/title" COM_JEDCHECKER_INFO_XML_NAME_JOOMLA="An extension name can't start with the word 'Joomla'" COM_JEDCHECKER_INFO_XML_NAME_JOOMLA_DERIVATIVE="Extensions that use 'Joomla' or a derivative of Joomla in the extension name need to be licensed by OSM" -COM_JEDCHECKER_INFO_XML_URL_JOOMLA_DERIVATIVE="Extensions that use 'Joomla' or a derivative of Joomla in the domain name need to be licensed by OSM" +COM_JEDCHECKER_INFO_XML_URL_JOOMLA_DERIVATIVE="Extensions that use 'Joomla' or a derivative of Joomla in the domain name ('%s') need to be licensed by OSM" COM_JEDCHECKER_INFO_XML_NAME_ADMIN_MENU="The admin menu name '%1$s' isn't the same as the extension name '%2$s'" COM_JEDCHECKER_INFO_XML_NAME_PLUGIN_FORMAT="The name of the plugin ('%s') must comply with the JED naming conventions in the form '{Type} - {Extension Name}'" COM_JEDCHECKER_RULE_PH1="PHP Headers missing GPL License Notice" diff --git a/administrator/components/com_jedchecker/libraries/rules/xmlinfo.php b/administrator/components/com_jedchecker/libraries/rules/xmlinfo.php index c3e3921..b010207 100644 --- a/administrator/components/com_jedchecker/libraries/rules/xmlinfo.php +++ b/administrator/components/com_jedchecker/libraries/rules/xmlinfo.php @@ -247,8 +247,19 @@ class JedcheckerRulesXMLinfo extends JEDcheckerRule if (stripos($url, 'joom') !== false) { $domain = (strpos($url, '//') === false) ? $url : parse_url(trim($url), PHP_URL_HOST); - if (stripos($domain, 'joom') !== false) { - $this->report->addWarning($file, JText::_('COM_JEDCHECKER_INFO_XML_URL_JOOMLA_DERIVATIVE')); + + if (stripos($domain, 'joom') !== false) + { + // Remove "www." subdomain prefix + $domain = preg_replace('/^www\./', '', $domain); + + // Approved domains from https://tm.joomla.org/approved-domains.html + $approvedDomains = file(__DIR__ . '/xmlinfo/approved-domains.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); + + if (!in_array($domain, $approvedDomains, true)) + { + $this->report->addError($file, JText::sprintf('COM_JEDCHECKER_INFO_XML_URL_JOOMLA_DERIVATIVE', $url)); + } } } diff --git a/administrator/components/com_jedchecker/libraries/rules/xmlinfo/approved-domains.txt b/administrator/components/com_jedchecker/libraries/rules/xmlinfo/approved-domains.txt new file mode 100644 index 0000000..6e8c234 --- /dev/null +++ b/administrator/components/com_jedchecker/libraries/rules/xmlinfo/approved-domains.txt @@ -0,0 +1,46 @@ +joomla.org + +hotjoomlatemplates.com +joomlanl.nl +joomla-templates.com +joomla-update.org +joomlaportal.ru +joomlavia.com +joomlatranslate.com +joomlamarketplace.online +hotjoomlatemplates.com +joomlatema.net +joomla.it +joomlaalger.org +joomla.cafe +joomlatwincities.org +joomlausersnj.com +joomlausersnyc.org +joomlact.org +joomlachicagonorth.com +joomlanh.org +joomlanh.org +joomlacarioca.com.br +novajoomla.com +joomlazur.com +joomladallas.org +joomlariodejaneiro.com.br +joomlatenerife.org +joomlage.com +joomlamadrid.org +joomschool.com +usingjoomla.com +joomla.cymru +joomlavigo.es +jug-warszawa.joomla.pl +joomlavalencia.net +jug-silesia.joomla.pl +jug-poznan.joomla.pl +joomla-canberra.org.au +joomlapay.com +joomlalondon.co.uk +mobilejoomla.com/ +myjoomla.com +joomlacontenteditor.net +joomlalabs.com +modernjoomla.com