33
2
mirror of https://github.com/joomla-extensions/jedchecker.git synced 2024-12-29 04:42:36 +00:00

check domain name against the list of approved domains

This commit is contained in:
Denis Ryabov 2021-02-24 00:24:48 +03:00
parent 5771fb0203
commit c11c23c15a
3 changed files with 60 additions and 3 deletions

View File

@ -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"

View File

@ -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));
}
}
}

View File

@ -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