Make WordPress Core

Opened 18 years ago

Closed 18 years ago

#4440 closed defect (bug) (invalid)

Several importers use add_option "wrong"

Reported by: nazgul's profile Nazgul Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Administration Keywords:
Focuses: Cc:

Description

The dotclear and textpattern importers pass incorrect arguments to add_option.

Function signature:

function add_option($name, $value = '', $description= '', $autoload = 'yes')

Usage (pseudocode):

add_option('option', $value, true));

So they're passing true to the description parameter, which isn't quite usefull. On the other hand, passing true to autoload also won't work, because it has an implicit check for the string 'yes', which would fail.

I don't have much experience with the importers and therefore don't know what the intended behaviour is and therefore don't know how to fix this. I just noticed this stange behaviour while working on another ticket.

Change History (4)

#1 @markjaquith
18 years ago

We may deprecate the description (see #4398)

$autoload needs to be re-worked so that only 'yes' and 'no' are possible.

#2 @markjaquith
18 years ago

(In [5686]) Force $autoload to be either "yes" or "no". see #4440. props Nazgul

#3 @markjaquith
18 years ago

Now anything without explicit 'no' will be 'yes,' but the importers should still be patched so that they give a good example.

#4 @Nazgul
18 years ago

  • Keywords needs-patch removed
  • Milestone 2.3 (trunk) deleted
  • Resolution set to invalid
  • Status changed from new to closed

I need to learn to count brackets. :(

The true isn't passed as the description, but as the second argument to sanitize_user.

At least the patch by markjaquith made the code somewhat more robust. :)

Note: See TracTickets for help on using tickets.