WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 4 years ago

#25733 closed defect (bug) (wontfix)

Cannot activate a plugin with a plus (+) symbol in the plugin name

Reported by: godhulii_1985 Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.8
Component: Plugins Keywords: has-patch dev-feedback close
Focuses: Cc:

Description

I created a plugin having "+" in filename (allowed in windows) and found an error to activate the plugin. After searching a lot, it seems that the problem is in .php, you can find how this problem was reported in drupal community and their thoughts here: https://drupal.org/node/615418

To repeat this bug you just need to rename a plugin with "+" symbol in the filename and try to activate. The activation url becomes:
http://localhost/wordpress/wp-admin/plugins.php?action=activateplugin=hello+dolly%2Fhello.php&_wpnonce=XXXXXX

I tried to replace the + symbol in query string with %2B (its unicode value), this activated the plugin but also said: A fatal error occured, the plugin cannot be activate.


I messed up the process to repeat, so writing again:

  1. Rename a folder with + character in its filename
  2. Try to activate
  3. An error will occur, = First observation of error
  4. Now replace the + symbol with %2B and try again
  5. The plugin will be activated but in the status it will say it was not activated and an error occured = Second observation of error

In my opinion, although it might be an issue with the programming language, but wordpress can obviously inform coders about this.

Attachments (1)

25733.diff (550 bytes) - added by mauryaratan 6 years ago.

Download all attachments as: .zip

Change History (10)

#1 @godhulii_1985
6 years ago

  • Summary changed from Plus (+) symbol in plugin name cannot activate this to Cannot activate a plugin with a plus (+) symbol in the plugin name

#2 follow-up: @mauryaratan
6 years ago

There are certain characters which cannot be used as file name since they are reserved symbols and + is among one of the others:

; / ? : @ & = + $ ,

Let's see if anyone around got a solution for this.

#3 in reply to: ↑ 2 @godhulii_1985
6 years ago

Replying to mauryaratan:

There are certain characters which cannot be used as file name since they are reserved symbols and + is among one of the others:

; / ? : @ & = + $ ,

Let's see if anyone around got a solution for this.

I am in windows-8 and I can rename files with + in it. Maybe + is reserved in Linux?

@mauryaratan
6 years ago

#4 @mauryaratan
6 years ago

Renaming files with those character can be done on any OS I guess. Btw, it should accept + in URLs.

I just tested it and was able to replicate the issue. I made a small patch which fixes the issue - 25733.diff

Last edited 6 years ago by mauryaratan (previous) (diff)

#5 @mauryaratan
6 years ago

  • Keywords has-patch dev-feedback added

#6 @godhulii_1985
6 years ago

  • Version set to trunk

#7 @DrewAPicture
4 years ago

  • Keywords close added
  • Owner set to dd32
  • Status changed from new to assigned

@mauryaratan: Using urlencode() here probably won't work since the value sent in the request is the path/to/file+name.php.

@dd32: Is "+" something we want to support/handle in plugin filenames? Reproduced on latest trunk.

#8 @dd32
4 years ago

  • Owner dd32 deleted

Personally I'm not really interested in supporting plugins which use something other than [a-zA-Z0-9_-] as their folder name, we refer to that path in multiple places and use it for a wide range of keys.

Since we don't currently support it, I don't see a need to add support for it really.

#9 @dd32
4 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.