Opened 2 years ago
Last modified 2 years ago
#16942 new defect
Dead code in add_query_arg()
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | General | Version: | 3.1 |
| Severity: | trivial | Keywords: | has-patch commit |
| Cc: |
Description
As it just has been checked that $uri contains at least one ?, then exploding $uri on ? with a limit of 2 must return two elements, right?
if ( strpos( $uri, '?' ) !== false ) {
$parts = explode( '?', $uri, 2 );
if ( 1 == count( $parts ) ) {
So the if clause can never be true, the code is dead.
Attachments (1)
Change History (5)
- Keywords commit added
- Severity changed from normal to trivial
Looks right with the edgecases of ?test and test.php?, an empty item will be returned before, and after respectively, resulting in always having a count of 2.
Note: See
TracTickets for help on using
tickets.

Stripping the dead.