security update for uuid xmlsitemap file_field_path
This commit is contained in:
@@ -4,12 +4,10 @@ package = XML sitemap
|
||||
core = 7.x
|
||||
dependencies[] = xmlsitemap
|
||||
dependencies[] = i18n
|
||||
files[] = xmlsitemap_i18n.module
|
||||
files[] = xmlsitemap_i18n.test
|
||||
|
||||
; Information added by Drupal.org packaging script on 2016-05-25
|
||||
version = "7.x-2.3"
|
||||
; Information added by Drupal.org packaging script on 2018-10-09
|
||||
version = "7.x-2.6"
|
||||
core = "7.x"
|
||||
project = "xmlsitemap"
|
||||
datestamp = "1464191061"
|
||||
|
||||
datestamp = "1539120486"
|
||||
|
@@ -1,5 +1,10 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Main file for XML sitemap i18n.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implements hook_xmlsitemap_context_info().
|
||||
*/
|
||||
@@ -88,14 +93,18 @@ function xmlsitemap_i18n_query_xmlsitemap_generate_alter(QueryAlterableInterface
|
||||
// Current language and language neutral.
|
||||
$query->condition('x.language', array($current, LANGUAGE_NONE));
|
||||
break;
|
||||
|
||||
case 'mixed':
|
||||
// Mixed current language (if available) or default language (if not) and language neutral.
|
||||
// Mixed current language (if available) or default language (if not) and
|
||||
// language neutral.
|
||||
$query->condition('x.language', array($current, $default, LANGUAGE_NONE));
|
||||
break;
|
||||
|
||||
case 'default':
|
||||
// Only default language and language neutral.
|
||||
$query->condition('x.language', array($default, LANGUAGE_NONE));
|
||||
break;
|
||||
|
||||
case 'strict':
|
||||
// Only current language (for nodes), simple for all other types.
|
||||
$node_condition = db_and();
|
||||
@@ -109,6 +118,7 @@ function xmlsitemap_i18n_query_xmlsitemap_generate_alter(QueryAlterableInterface
|
||||
$condition->condition($normal_condition);
|
||||
$query->condition($condition);
|
||||
break;
|
||||
|
||||
case 'off':
|
||||
// All content. No language conditions apply.
|
||||
break;
|
||||
|
@@ -2,19 +2,29 @@
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Unit tests for the xmlsitemap_i18n module.
|
||||
* Unit tests for the xmlsitemap_i18n project.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Common base test class for XML sitemap internationalization tests.
|
||||
*/
|
||||
class XMLSitemapI18nWebTestCase extends XMLSitemapTestHelper {
|
||||
|
||||
/**
|
||||
* Admin User.
|
||||
*
|
||||
* @var string
|
||||
*
|
||||
* @codingStandardsIgnoreStart
|
||||
*/
|
||||
protected $admin_user;
|
||||
|
||||
/**
|
||||
* Set up an administrative user account and testing keys.
|
||||
*
|
||||
* @codingStandardsIgnoreEnd
|
||||
*/
|
||||
function setUp($modules = array()) {
|
||||
public function setUp($modules = array()) {
|
||||
// Call parent::setUp() allowing test cases to pass further modules.
|
||||
$modules[] = 'locale';
|
||||
$modules[] = 'translation';
|
||||
@@ -29,7 +39,8 @@ class XMLSitemapI18nWebTestCase extends XMLSitemapTestHelper {
|
||||
variable_set('language_negotiation', LOCALE_LANGUAGE_NEGOTIATION_URL_PREFIX);
|
||||
|
||||
// Create the two different language-context sitemaps.
|
||||
db_query("DELETE FROM {xmlsitemap_sitemap}");
|
||||
db_delete('xmlsitemap_sitemap')->execute();
|
||||
|
||||
$sitemap = new stdClass();
|
||||
$sitemap->context = array('language' => 'en');
|
||||
xmlsitemap_sitemap_save($sitemap);
|
||||
@@ -37,9 +48,17 @@ class XMLSitemapI18nWebTestCase extends XMLSitemapTestHelper {
|
||||
$sitemap->context = array('language' => 'fr');
|
||||
xmlsitemap_sitemap_save($sitemap);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* I18n Test.
|
||||
*/
|
||||
class XMLSitemapI18nTest extends XMLSitemapI18nWebTestCase {
|
||||
|
||||
/**
|
||||
* Get Info.
|
||||
*/
|
||||
public static function getInfo() {
|
||||
return array(
|
||||
'name' => 'XML sitemap i18n tests',
|
||||
@@ -49,7 +68,10 @@ class XMLSitemapI18nTest extends XMLSitemapI18nWebTestCase {
|
||||
);
|
||||
}
|
||||
|
||||
function testLanguageSelection() {
|
||||
/**
|
||||
* Language Selection.
|
||||
*/
|
||||
public function testLanguageSelection() {
|
||||
// Create our three different language nodes.
|
||||
$node = $this->addSitemapLink(array('type' => 'node', 'language' => LANGUAGE_NONE));
|
||||
$node_en = $this->addSitemapLink(array('type' => 'node', 'language' => 'en'));
|
||||
@@ -104,9 +126,17 @@ class XMLSitemapI18nTest extends XMLSitemapI18nWebTestCase {
|
||||
$this->assertRawSitemapLinks($node_fr, $link, $link_fr);
|
||||
$this->assertNoRawSitemapLinks($node, $node_en, $link_en);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Node Test.
|
||||
*/
|
||||
class XMLSitemapI18nNodeTest extends XMLSitemapI18nWebTestCase {
|
||||
|
||||
/**
|
||||
* Get Info.
|
||||
*/
|
||||
public static function getInfo() {
|
||||
return array(
|
||||
'name' => 'XML sitemap i18n node tests',
|
||||
@@ -116,7 +146,10 @@ class XMLSitemapI18nNodeTest extends XMLSitemapI18nWebTestCase {
|
||||
);
|
||||
}
|
||||
|
||||
function setUp($modules = array()) {
|
||||
/**
|
||||
* Setup.
|
||||
*/
|
||||
public function setUp($modules = array()) {
|
||||
$modules[] = 'xmlsitemap_node';
|
||||
parent::setUp($modules);
|
||||
|
||||
@@ -125,7 +158,10 @@ class XMLSitemapI18nNodeTest extends XMLSitemapI18nWebTestCase {
|
||||
$this->drupalLogin($this->admin_user);
|
||||
}
|
||||
|
||||
function testNodeLanguageData() {
|
||||
/**
|
||||
* Node Language Data.
|
||||
*/
|
||||
public function testNodeLanguageData() {
|
||||
$node = $this->drupalCreateNode(array());
|
||||
|
||||
$this->drupalPost('node/' . $node->nid . '/edit', array('language' => 'en'), t('Save'));
|
||||
@@ -136,4 +172,5 @@ class XMLSitemapI18nNodeTest extends XMLSitemapI18nWebTestCase {
|
||||
$link = $this->assertSitemapLink('node', $node->nid);
|
||||
$this->assertIdentical($link['language'], 'fr');
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user