|
@ -113,8 +113,8 @@ class Api { |
|
|
// Handle country field |
|
|
// Handle country field |
|
|
if (isset($post->body_nomarkup) && $this->config['country_flags']) { |
|
|
if (isset($post->body_nomarkup) && $this->config['country_flags']) { |
|
|
$modifiers = extract_modifiers($post->body_nomarkup); |
|
|
$modifiers = extract_modifiers($post->body_nomarkup); |
|
|
if (isset($modifiers['flag']) && isset($modifiers['flag alt']) && preg_match('/^[a-z]{2}$/', $modifiers['flag'])) { |
|
|
if (isset($modifiers['flag']) && isset($modifiers['flag alt']) && preg_match('/^[1-9a-z_-]{2,}$/', $modifiers['flag'])) { |
|
|
$country = strtoupper($modifiers['flag']); |
|
|
$country = strtolower($modifiers['flag']); |
|
|
if ($country) { |
|
|
if ($country) { |
|
|
$apiPost['country'] = $country; |
|
|
$apiPost['country'] = $country; |
|
|
$apiPost['country_name'] = $modifiers['flag alt']; |
|
|
$apiPost['country_name'] = $modifiers['flag alt']; |
|
|