security update for uuid xmlsitemap file_field_path

This commit is contained in:
2018-10-13 16:01:24 +02:00
parent f7ae17e6c4
commit a163542966
109 changed files with 5458 additions and 1952 deletions

View File

@@ -0,0 +1,83 @@
CONTENTS OF THIS FILE
---------------------
* Introduction
* Requirements
* Recommended modules
* Installation
* Configuration
* Maintainers
INTRODUCTION
------------
The XML sitemap taxonomy module, part of the XML sitemap
(https://www.drupal.org/project/xmlsitemap) package, adds taxonomy term links
to the sitemap. The XML sitemap module creates a sitemap that conforms to the
sitemaps.org specification. This helps search engines to more intelligently
crawl a website and keep their results up to date.
* For a full description of the module visit
https://www.drupal.org/documentation/modules/xmlsitemap
* To submit bug reports and feature suggestions, or to track changes visit
https://www.drupal.org/project/issues/xmlsitemap
REQUIREMENTS
------------
This module requires the following modules:
XML sitemap - (https://www.drupal.org/project/xmlsitemap)
RECOMMENDED MODULES
-------------------
* Ctools - (https://www.drupal.org/project/ctools)
* RobotsTxt - (https://www.drupal.org/project/robotstxt)
* Site Verification - (https://www.drupal.org/project/site_verify)
* Browscap - (https://www.drupal.org/project/browscap)
* Vertical Tabs - (https://www.drupal.org/project/vertical_tabs)
INSTALLATION
------------
This is a submodule of the XML sitemap module. Install the XML sitemap module as
you would normally install a contributed Drupal module. Visit
https://www.drupal.org/node/895232 for more information.
CONFIGURATION
-------------
1. Install the XML sitemap module.
2. Enable the XML sitemap module.
3. To include taxonomy terms in the sitemap, enable the XML sitemap taxonomy
submodule.
4. Navigate to Administration > Structure > Taxonomy.
5. To include a whole vocabulary in the sitemap, click "edit vocabulary".
Select the XML sitemap field set. Under "Inclusion" change "Excluded" to
become "Included". Save.
6. To include a single vocabulary term in the sitemap, select edit vocabulary.
Select the vocabulary term to be included. Select the XML sitemap field set.
Under "Inclusion" change "Excluded" to become "Included". Save.
7. Once that is all complete, go to Configurations > Search and Metadata > XML
Sitemap.
8. Select the Rebuild Links tab in the upper right.
9. Select "Rebuild sitemap" even if the message says that you do not need to.
10. Now you're taken back to the configuration page which shows you the link to
your XML sitemap which you can click and confirm that pages have been added.
MAINTAINERS
-----------
* Andrei Mateescu (amateescu) - https://www.drupal.org/u/amateescu
* Renato Gonçalves (RenatoG) - https://www.drupal.org/u/RenatoG
* Dave Reid - https://www.drupal.org/u/dave-reid
* Juampy NR (juampynr) - https://www.drupal.org/u/juampynr
* Tasya Rukmana (tadityar) - https://www.drupal.org/u/tadityar

View File

@@ -4,13 +4,10 @@ package = XML sitemap
core = 7.x
dependencies[] = xmlsitemap
dependencies[] = taxonomy
files[] = xmlsitemap_taxonomy.module
files[] = xmlsitemap_taxonomy.install
files[] = xmlsitemap_taxonomy.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"

View File

@@ -2,7 +2,7 @@
/**
* @file
* Install and uninstall schema and functions for the xmlsitemap_taxonomy module.
* Install and uninstall schema and functions for the xmlsitemap_taxonomy.
*/
/**

View File

@@ -1,5 +1,10 @@
<?php
/**
* @file
* Main file for XML sitemap taxonomy.
*/
/**
* Implements hook_entity_info_alter().
*/
@@ -43,7 +48,7 @@ function xmlsitemap_taxonomy_xmlsitemap_index_links($limit) {
/**
* Process taxonomy term sitemap links.
*
* @param $tids
* @param array $tids
* An array of taxonomy term IDs.
*/
function xmlsitemap_taxonomy_xmlsitemap_process_taxonomy_term_links(array $tids) {
@@ -103,7 +108,7 @@ function xmlsitemap_taxonomy_vocabulary_update(stdClass $vocabulary) {
}
/**
* Implements hook_taxonomy_term_insert() {
* Implements hook_taxonomy_term_insert().
*/
function xmlsitemap_taxonomy_term_insert(stdClass $term) {
$link = xmlsitemap_taxonomy_create_link($term);
@@ -111,7 +116,7 @@ function xmlsitemap_taxonomy_term_insert(stdClass $term) {
}
/**
* Implements hook_taxonomy_term_update() {
* Implements hook_taxonomy_term_update().
*/
function xmlsitemap_taxonomy_term_update(stdClass $term) {
$link = xmlsitemap_taxonomy_create_link($term);
@@ -119,7 +124,7 @@ function xmlsitemap_taxonomy_term_update(stdClass $term) {
}
/**
* Implements hook_taxonomy_term_delete() {
* Implements hook_taxonomy_term_delete().
*/
function xmlsitemap_taxonomy_term_delete(stdClass $term) {
xmlsitemap_link_delete('taxonomy_term', $term->tid);
@@ -143,9 +148,10 @@ function xmlsitemap_taxonomy_field_extra_fields() {
/**
* Create a sitemap link from a taxonomy term.
*
* @param $term
* @param object $term
* A taxonomy term object.
* @return
*
* @return array
* An array representing a sitemap link.
*/
function xmlsitemap_taxonomy_create_link(stdClass &$term) {
@@ -182,20 +188,22 @@ function xmlsitemap_taxonomy_create_link(stdClass &$term) {
/**
* Calculate the priority of a taxonomy term based on depth and weight.
*
* Function xmlsitemap_taxonomy_calculate_term_priority(stdClass $term) {
* // Calculate priority.
* // Min weight = -128
* // Max weight = 127
* // Max depth = ?
* }
*/
//function xmlsitemap_taxonomy_calculate_term_priority(stdClass $term) {
// // Calculate priority.
// // Min weight = -128
// // Max weight = 127
// // Max depth = ?
//}
/**
* Find the tree depth of a taxonomy term.
*
* @param $term
* @param object $term
* A taxonomy term object.
* @return
*
* @return array
* The tree depth of the term.
*/
function xmlsitemap_taxonomy_get_term_depth(stdClass $term) {
@@ -221,12 +229,16 @@ function xmlsitemap_taxonomy_get_term_depth(stdClass $term) {
/**
* Find the number of nodes that are associated with a taxonomy term.
*
* @param $term
* @param obejct $term
* A taxonomy term object.
* @return
*
* @return int
* The number of nodes associated with the term.
*
* @codingStandardsIgnoreStart
*/
function xmlsitemap_taxonomy_get_node_count(stdClass $term) {
// @codingStandardsIgnoreEnd
// @todo Use db_rewrite_sql() w/ switch user.
return db_query_range("SELECT COUNT(ti.nid) FROM {taxonomy_index} ti LEFT JOIN {node n} USING (nid) WHERE ti.tid = :tid AND n.status = 1", 0, 1, array(':tid' => $term->tid))->fetchField();
}
@@ -234,7 +246,7 @@ function xmlsitemap_taxonomy_get_node_count(stdClass $term) {
/**
* Implements hook_entity_query_alter().
*
* @todo Remove when http://drupal.org/node/1054162 is fixed.
* @todo Remove when https://www.drupal.org/node/1054162 is fixed.
*/
function xmlsitemap_taxonomy_entity_query_alter($query) {
$conditions = &$query->entityConditions;
@@ -243,7 +255,13 @@ function xmlsitemap_taxonomy_entity_query_alter($query) {
if (isset($conditions['entity_type']) && $conditions['entity_type']['value'] == 'taxonomy_term' && isset($conditions['bundle'])) {
// We can only support the operators that are explicit in values.
if (in_array($conditions['bundle']['operator'], array(NULL, '=', '!=', 'IN', 'NOT IN'))) {
if (in_array($conditions['bundle']['operator'], array(
NULL,
'=',
'!=',
'IN',
'NOT IN',
))) {
$vids = array();
// Convert vocabulary machine names to vocabulary IDs.

View File

@@ -5,10 +5,32 @@
* Unit tests for the xmlsitemap_taxonomy module.
*/
/**
* Functional Test.
*/
class XMLSitemapTaxonomyFunctionalTest extends XMLSitemapTestHelper {
/**
* Normal User.
*
* @var string
*
* @codingStandardsIgnoreStart
*/
protected $normal_user;
/**
* Terms.
*
* @var array
*/
protected $terms = array();
/**
* Get Info.
*
* @codingStandardsIgnoreEnd
*/
public static function getInfo() {
return array(
'name' => 'XML sitemap taxonomy',
@@ -17,7 +39,10 @@ class XMLSitemapTaxonomyFunctionalTest extends XMLSitemapTestHelper {
);
}
function setUp($modules = array()) {
/**
* SetUp.
*/
public function setUp($modules = array()) {
$modules[] = 'xmlsitemap_taxonomy';
$modules[] = 'taxonomy';
parent::setUp($modules);
@@ -26,7 +51,10 @@ class XMLSitemapTaxonomyFunctionalTest extends XMLSitemapTestHelper {
$this->normal_user = $this->drupalCreateUser(array('access content'));
}
function testTaxonomySettings() {
/**
* TaxonomySettings.
*/
public function testTaxonomySettings() {
$this->drupalLogin($this->admin_user);
$edit = array(
@@ -46,4 +74,5 @@ class XMLSitemapTaxonomyFunctionalTest extends XMLSitemapTestHelper {
);
$this->drupalPost("admin/structure/taxonomy/{$vocabulary->machine_name}/add", $edit, 'Save');
}
}