Feature #87737

check if extensionName is valid

Added by Kay Strobach 29 days ago. Updated 15 days ago.

Status:
Needs Feedback
Priority:
Should have
Assignee:
-
Category:
Extension Manager
Target version:
-
Start date:
2019-02-19
Due date:
% Done:

0%

PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

Right noch ExtensionUtility::checkExtensionNameFormat fails to check the validity of the extension name, as just the empty case is

typo3/sysext/extbase/Classes/Utility/ExtensionUtility.php:243

    /**
     * Check a given extension name for validity.
     *
     * @param string $extensionName The name of the extension
     * @throws \InvalidArgumentException
     */
    protected static function checkExtensionNameFormat($extensionName)
    {
        if (empty($extensionName)) {
            throw new \InvalidArgumentException('The extension name must not be empty', 1239891990);
        }
    }

According to TER docs there are many more rules:

  • Allowed characters are: a-z (lowercase), 0-9 and '_' (underscore)
  • The key must not begin with one of the following prefixes: tx,user_,pages,tt_,sys_,ts_language_,csh_
  • Extension keys must not start with a number and must not start or end with an '_' (underscore)
  • An extension key must have minimum 3, maximum 30 characters (not counting underscores)

History

#1 Updated by Kay Strobach 29 days ago

I would expext that these rules are checked in that function.

#2 Updated by Georg Ringer 28 days ago

I think we should differentiate between released extensions in TER and local custom extensions. what do you think?

#3 Updated by Susanne Moog 15 days ago

  • Tracker changed from Bug to Feature
  • Category set to Extension Manager
  • Status changed from New to Needs Feedback

I'm not aware of the same restrictions as TER has applying to TYPO3 in general. I would not restrict local extension names because of TER rules (This would also be breaking).

Maybe a check could be introduced and displayed somewhere?

Also available in: Atom PDF