Index: branches/RC/core/units/general/country_states.php =================================================================== diff -u -r8929 -r10098 --- branches/RC/core/units/general/country_states.php (.../country_states.php) (revision 8929) +++ branches/RC/core/units/general/country_states.php (.../country_states.php) (revision 10098) @@ -1,14 +1,14 @@ CountriesWithStates); } - + /** * Prepares states dropdown based on country selected * @@ -40,7 +40,7 @@ $object->Fields[$state_field]['options'] = $states; $object->Fields[$state_field]['options'][''] = ''; } - + /** * Returns valid state code for state name and country code passed * @@ -51,28 +51,28 @@ function CheckState($state_name, $country_code) { if( !$this->CountryHasStates($country_code) ) return $state_name; - + $sql = 'SELECT sdStates.DestAbbr FROM '.TABLE_PREFIX.'StdDestinations AS sdStates LEFT JOIN '.TABLE_PREFIX.'Phrase AS p ON p.Phrase = sdStates.DestName LEFT JOIN '.TABLE_PREFIX.'StdDestinations AS sdCountries ON sdStates.DestParentId = sdCountries.DestId WHERE (sdStates.DestType = 2) AND (sdStates.DestParentId = sdCountries.DestId) AND - (p.LanguageId = %1$s) AND - (sdCountries.DestAbbr = %2$s) AND + (p.LanguageId = %1$s) AND + (sdCountries.DestAbbr = %2$s) AND ( (LOWER(sdStates.DestAbbr) = %3$s) OR (LOWER(sdStates.DestAbbr2) = %3$s) OR (LOWER(sdStates.DestName) = %3$s) OR (LOWER(p.Translation) = %3$s) )'; - - $state_name = trim( strtolower($state_name) ); + + $state_name = trim( mb_strtolower($state_name) ); $sql = sprintf($sql, $this->Application->GetVar('m_lang'), $this->Conn->qstr($country_code), $this->Conn->qstr($state_name) ); - + return $this->Conn->GetOne($sql); } - + function CheckStateField(&$event, $state_field, $country_field) { - + $items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) ); if($items_info) {