Feature #87737
opencheck if extensionName is valid
0%
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)
Updated by Kay Strobach almost 6 years ago
I would expext that these rules are checked in that function.
Updated by Georg Ringer almost 6 years ago
I think we should differentiate between released extensions in TER and local custom extensions. what do you think?
Updated by Susanne Moog over 5 years 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?
Updated by Kay Strobach over 4 years ago
More Information:
given you have an extension named:
vendor_whatever_<number>
This gets internally converted into
vendorWhatever<number>
After that it's reconverted back into the classic name which is then:
vendor_whatever<number>
The problem is that the last "_" is now gone, so the extension can not be loaded.
This can be fixed in various ways, IMHO the best solution is to display a clear warning about the restrictions about extension naming.
Updated by Christian Kuhn almost 3 years ago
- Status changed from Needs Feedback to New