Skip to content

Commit

Permalink
workaround to the get the customer order view working with email addr…
Browse files Browse the repository at this point in the history
…esses that include a "+" character
  • Loading branch information
Patrizio Bekerle committed Sep 2, 2015
1 parent 351f492 commit 6f5f894
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
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" ) )

This comment has been minimized.

Copy link
@andrerom

andrerom Sep 20, 2018

Contributor

maybe change to something like

// Allow usage of get parameter as well which is safer for some email formats
if ( $Email )
{
    $Email = urldecode( $Email );
}
else if ( $http->hasGetVariable( "email" ) )
{
    $Email = $http->getVariable( "email" );
}
{
$Email = $http->getVariable( "email" );
}

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

Expand Down

0 comments on commit 6f5f894

Please sign in to comment.