Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
base system
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
17 Oct 2010 at 16:55 UTC
Updated:
3 Dec 2010 at 20:40 UTC
Jump to comment: Most recent file
Problem
Goal
Details
[a-z][a-z0-9_]* anyway.| Comment | File | Size | Author |
|---|---|---|---|
| #11 | drupal.system-listing.11.patch | 4.93 KB | sun |
| #3 | drupal.system-listing.3.patch | 3.62 KB | sun |
| drupal.system-listing.0.patch | 3.48 KB | sun |
Comments
Comment #1
damien tournoud commentedThis would be *way* too restrictive.
A PHP function name is
[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*. We already have this magical regular expression in_menu_router_build().Comment #2
jacineThis is a big problem for Skinr. It causes packaged skin definitions (which are essentially micro themes) that reside in themes to appear on admin/appearance, like any other theme. Obviously the ability to enable a skin, that Drupal thinks is an actual theme is a disaster.
It's also a pretty silly bug in the first place. As @sun pointed out to me:
Pretty funny, but not very smart of Drupal. ;)
Comment #3
sunThanks -- changed to the correct pattern.
Comment #4
ChrisBryant commentedSubscribing, thanks for addressing this @sun!
Comment #5
jacineBased on Damien's comment in #1, the patch in #3 good to me.
Comment #6
dries commentedI understand the patch, and it looks good, I don't understand the environment in which this bug manifested itself.
Comment #7
sunFor example, the Skinr module instructs users/themers to put custom "skins", which are .info files, into their theme directory:
dropdown.info contains meta data about a "Dropdown menu" skin, which can be applied to all kind of elements in a Drupal site to style them like a dropdown menu.
However, after putting that .info file into that location, users suddenly see a "Dropdown menu" theme on the Themes administration page.
To work around this problem, modules like Skinr, which are using custom .info files for custom meta data, should be able to use a double file extension of
$plugin.skinr.info. Because that would lead to invalid basenames for Drupal core's default usage of .info files; i.e., a basename ofsomething.skinris neither a valid module name nor a valid theme name, so it should not be found and taken up by Drupal core in the first place.Comment #8
sun#3: drupal.system-listing.3.patch queued for re-testing.
Comment #9
sun#3: drupal.system-listing.3.patch queued for re-testing.
Comment #10
owen barton commentedThe "[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*" looks like it would be really good to have as a constant (we can apply to the case in _menu_router_build() also).
Other than that, I think this looks great - the fact that you can currently register module that have unusable names is clearly a bug.
Comment #11
sunGood call.
Comment #12
sunPattern has been moved into a constant. Any feedback?
Comment #13
owen barton commentedThis addresses #10, otherwise is functionally equivalent to #3 - looks good to me
Comment #14
dries commentedNice clean-up. Committed to CVS HEAD. Thanks.