Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F727012
D474.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Jan 6, 5:07 AM
Size
1 KB
Mime Type
text/x-diff
Expires
Tue, Jan 7, 5:07 AM (2 d, 22 h ago)
Engine
blob
Format
Raw Data
Handle
537081
Attached To
D474: MINC-202 - Fix currency selection in Site Domain scenario
D474.diff
View Options
Index: branches/5.2.x/units/currencies/currencies_event_handler.php
===================================================================
--- branches/5.2.x/units/currencies/currencies_event_handler.php
+++ branches/5.2.x/units/currencies/currencies_event_handler.php
@@ -279,11 +279,21 @@
*/
protected function OnChangeCurrency($event)
{
- $currency_iso = $this->Application->GetVar('curr_iso');
+ $currency_iso = $this->Application->GetVar('curr_iso', '');
+
+ $sql = 'SELECT CurrencyId
+ FROM ' . TABLE_PREFIX . 'Currencies
+ WHERE ISO = ' . $this->Conn->qstr($currency_iso) . ' AND Status = ' . STATUS_ACTIVE;
+ $currency_id = $this->Conn->GetOne($sql);
+
+ if ( $currency_id === false ) {
+ return;
+ }
+
$available_currencies = $this->Application->siteDomainField('Currencies');
if ($available_currencies) {
- if (strpos($available_currencies, '|' . $currency_iso . '|') === false) {
+ if (strpos($available_currencies, '|' . $currency_id . '|') === false) {
// currency isn't allowed in site domain
return ;
}
Event Timeline
Log In to Comment