Requirement to publish an extension to JED

Here you can contact the editors of our Extensions site, as well as access infomation relating to this site.

Moderator: JED Team

Forum rules
Forum Rules
READ ME <-- please read before posting, this means YOU.
Locked
svtemplates
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Sat Feb 29, 2020 5:33 pm

Requirement to publish an extension to JED

Post by svtemplates » Sat Jan 23, 2021 10:18 am

I have a question:
If an extension uses a php file that starts with

Code: Select all

define( '_JEXEC', 1 );
instead of

Code: Select all

defined('_JEXEC') or die;
will it be accepted for publication in JED?
Note: The component jedchecker gives an error
Thank you to the responders

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 17426
Joined: Thu Feb 15, 2007 5:48 am
Location: Sydney, Australia

Re: Requirement to publish an extension to JED

Post by toivo » Sat Jan 23, 2021 11:51 am

The extension is unlikely to be accepted if the JED Checker highlights an error like that. It is a security risk.

Joomla has only a handful of scripts that start with the constant that prevents direct access and none of them are extensions.
Toivo Talikka, Global Moderator

User avatar
anibal_sanchez
Joomla! Explorer
Joomla! Explorer
Posts: 487
Joined: Sat Mar 17, 2012 3:01 pm
Location: Oviedo, Asturias, Spain
Contact:

Re: Requirement to publish an extension to JED

Post by anibal_sanchez » Sat Jan 23, 2021 12:01 pm

Hi,

The lines of code that you are presenting are functionally different.

The first sample code "define( '_JEXEC', 1 );" defines a constant that it is owned by Joomla. In theory, an extension should never define the constant _JEXEC. Since the constant is defined by the CMS, if your extension tries to define it, PHP shows a warning.

The second sample code "defined('_JEXEC') or die;" is the security restriction that must be included in all the files owned by an extension.

Best Regards
@anibal_sanchez - Former JED Team Leader.

Prefix PHP Libraries & Projects: https://php-prefixer.com
My Extensions: https://extly.com


Locked

Return to “extensions.joomla.org - Feedback/Information”