Opened 12 years ago
Closed 12 years ago
#21553 closed enhancement (fixed)
Remove dupe/deprecated code from sites.php
Reported by: | wonderboymusic | Owned by: | nacin |
---|---|---|---|
Milestone: | 3.5 | Priority: | normal |
Severity: | normal | Version: | 3.0 |
Component: | Multisite | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
current_user_can( 'manage_sites' )
is called at the top of sites.php
, so it doesn't need to be present in every single case
in the switch
statement.
The "updated" message is currently being output in the middle of an H2, I moved that below it.
The form handler is looking at every action and then passing a different action to the redirect that is only read by the message switch
statement. This is weird, so I moved the action name to the "updated" query arg, since updated having a value is the same thing as updated=true&action=non-colliding-name
.
There is no row action for matureblog
and unmatureblog
(I scanned the whole codebase), so I removed them.
Attachments (1)
Change History (8)
#3
follow-up:
↓ 4
@
12 years ago
Any reason to be using strict comparison in the $doaction
comparisons? Switches use loose comparison (http://php.net/manual/en/control-structures.switch.php), so you could have an action argument that was capitalised and would go to the correct case, but fail in the strict comparison.
Being slightly pedantic, but still seems odd.
#4
in reply to:
↑ 3
@
12 years ago
Replying to kawauso:
Any reason to be using strict comparison in the
$doaction
comparisons? Switches use loose comparison (http://php.net/manual/en/control-structures.switch.php), so you could have an action argument that was capitalised and would go to the correct case, but fail in the strict comparison.
Loose comparisons are not case-insensitive.
var_dump( 'apple' == 'APPLE', 'apple' === 'APPLE' ); // bool(false) // bool(false)
The matureblog and unmatureblog handlers are there in case plugins add simple mature/unmature action links. We do actually support "mature" blogs in core, just not in the UI.
Otherwise, looks good.