Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

customer order view workaround for "+" in email addresses #1199

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion design/admin/templates/shop/orderlist.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
{if is_null($Orders.item.account_name)}
<s><i>{'( removed )'|i18n( 'design/admin/shop/orderlist' )}</i></s>
{else}
<a href={concat( '/shop/customerorderview/', $Orders.item.user_id, '/', $Orders.item.account_email )|ezurl}>{$Orders.item.account_name|wash}</a>
<a href={concat( '/shop/customerorderview/', $Orders.item.user_id, '?email=', $Orders.item.account_email|urlencode )|ezurl}>{$Orders.item.account_name|wash}</a>
{/if}
</td>

Expand Down
7 changes: 7 additions & 0 deletions kernel/shop/customerorderview.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@
$tpl = eZTemplate::factory();

$Email = urldecode( $Email );

// workaround because it seems not possible to get an urlencoded "+" character accross $Params
if ( $http->hasGetVariable( "email" ) )
{
$Email = $http->getVariable( "email" );
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But, if i'm not wrong, here you are remove Email Param from the url, right? i mean, this is not valid as you won't have Email as Param anymore

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I use a normal "get" parameter in orderlist.tpl, because "+" get through with them. I give this parameter a higher priority in the customerorderview.php. Does that seem wrong to you, @crevillo?

Of course fixing the bug (?) with $Params would be the better solution, but I don't know the consequences of doing that...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pbek. no, the patch is good. forget my comment. just thought that now this line
could throw a php notice or something now $Params['Email'] won't be set in this new urls.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not very happy with that patch, because the real problem lies in $Params (and a missing urlencode()). ;)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you have in mind changing it to?

as for Params, it kind of still need to be there for bc, like is the case now in 6f5f894

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I fail to understand what you are talking about. :)
Changing what to? And what "bc"?

$productList = eZOrder::productList( $CustomerID, $Email );
$orderList = eZOrder::orderList( $CustomerID, $Email );

Expand Down