Make WordPress Core

Opened 12 years ago

Closed 11 years ago

#23402 closed defect (bug) (duplicate)

remove_query_arg messing up some URLs

Reported by: lumpysimon's profile lumpysimon Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: Cc:

Description

I'm using remove_query_arg to strip utm campaign parameters from user-submitted URLs, but for some URLs it is replacing dots with underscores.

E.g. if you pass http://www.nanowerk.com/news2/newsid=28843.php into this:

$url = remove_query_arg( array(
	'utm_source'
	'utm_medium',
	'utm_campaign',
	'utm_term',
	'utm_content'
	), $url );

it returns http://www_nanowerk_com/news2/newsid=28843.php

Change History (4)

#1 @lumpysimon
12 years ago

  • Cc piemanek@… added

#2 @SergeyBiryukov
12 years ago

ticket:23284:23284.2.diff would fix this.

The URL appears to be invalid though, per ticket:23284:3. Shouldn't it be ?newsid=28843.php rather than newsid=28843.php?

#3 @lumpysimon
12 years ago

No, that's the correct URL, but I agree it does look odd. If you go to their homepage you'll see all their URLs are in that format.

#4 @nacin
11 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #23284.

This is fixed as of [24444] and [24445].

Note: See TracTickets for help on using tickets.