I need to know how to get a +
-delimited string to be appended to the end of the URL path without the +
character being URL encoded.
Why: I'm trying to pass arguments to a View. I'm working on a custom module to conditionally route webform confirmations to a View. The view will take multiple arguments, returning all nodes matching the arguments (currently trying to do this with Views 3.0).
I've done proof-of-concept tests on the view that demonstrate that for a view with a path of, say, cbos/name1+name2
it will produce the desired result (i.e., displays nodes name1 and name2). So I know that this can be done from the Views side. (I'm pretty certain at this point Views has nothing to do with it, I just need to make clear why I need to do this.)
The problem is on the custom module / webform side.
I'm creating the URL path using the following code:
while ($cbo_short_name = db_fetch_array($result)) {
if ($count > 0) $delim = '+';
$cbo_short_names_arg .= $delim.$cbo_short_name['cbo_short_name'];
$count = $count + 1;
}
$redirecturl = "cbos/".$cbo_short_names_arg;
$node->webform['confirmation'] = drupal_urlencode($redirecturl); // ... have also tried setting this via the form settings page using tokens
... where $cbo_short_name
is an array of short names (usually initials) for organizations. (There's usually only 1, but in about 15% of cases there will be 2 or 3 short names. The visitor has to be shown all of them. Hence, the View)
What this should do is produce a URL path of the form given above; what's happening is that '+' is getting URL encoded as %2B (e.g. cbos/name1%2Bname2
), which breaks the Views argument string -- only the first result is returned.
If I could somehow force '+' to be passed intact, without URL encoding, this would work. But I'm at a loss for how to do that.
What I've tried so far:
- Setting the confirmation URL on the form settings page (preferred, since I don't have to hard code it).
- Setting the redirect URL programmatically (what you see above).
Both work to set a value, but in both cases the delimiters are URL encoded in the resulting URL path.