Commit dd9ed6fd authored by catch's avatar catch

Revert "Issue #1272840 by attiks, pp: Add upgrade path for language domains and validation."

This reverts commit 9bd7daa8.
parent bac1fba1
......@@ -330,19 +330,6 @@ function language_negotiation_configure_url_form_validate($form, &$form_state) {
form_error($form['domain'][$langcode], t('The domain for %language, %value, is not unique.', array('%language' => $language->name, '%value' => $value)));
}
}
// Domain names should not contain protocol and/or ports.
foreach ($languages as $langcode => $name) {
$value = $form_state['values']['domain'][$langcode];
if (!empty($value)) {
// Ensure we have a protocol but only one protocol in the setting for
// parse_url() checking against the hostname.
$host = 'http://' . str_replace(array('http://', 'https://'), '', $value);
if (parse_url($host, PHP_URL_HOST) != $value) {
form_error($form['domain'][$langcode], t('The domain for %language may only contain the domain name, not a protocol and/or port.', array( '%language' => $name)));
}
}
}
}
/**
......
......@@ -2278,8 +2278,8 @@ class LocaleUILanguageNegotiationTest extends DrupalWebTestCase {
$this->assertResponse(404, "Unknown language path prefix should return 404");
// Setup for domain negotiation, first configure the language to have domain
// URL.
$edit = array("domain[$langcode]" => $language_domain);
// URL. We use https and a port to make sure that only the domain name is used.
$edit = array("domain[$langcode]" => "https://$language_domain:99");
$this->drupalPost("admin/config/regional/language/detection/url", $edit, t('Save configuration'));
// Set the site to use domain language negotiation.
......
......@@ -78,18 +78,4 @@ class LanguageUpgradePathTestCase extends UpgradePathTestCase {
$this->drupalGet('node/add/page');
$this->assertNoFieldByName('langcode');
}
/**
* Tests language domain upgrade path.
*/
public function testLanguageUrlUpgrade() {
$language_domain = 'ca.example.com';
db_update('languages')->fields(array('domain' => 'http://' . $language_domain . ':8888'))->condition('language', 'ca')->execute();
variable_set('locale_language_negotiation_url_part', 1);
$this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
$domains = locale_language_negotiation_url_domains();
$this->assertTrue($domains['ca'] == $language_domain, t('Language domain for Catalan properly upgraded.'));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment