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,79 @@
CONTENTS OF THIS FILE
---------------------
* Introduction
* Requirements
* Recommended modules
* Installation
* Configuration
* Maintainers
INTRODUCTION
------------
The XML sitemap menu module, part of the XML sitemap
(https://www.drupal.org/project/xmlsitemap) package, enables menu links to be on
the site map. 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 module:
* 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 further information.
CONFIGURATION
-------------
1. Install the XML sitemap module.
2. Enable the XML sitemap module.
3. To include menu items in the sitemap, enable the XML sitemap menu submodule.
4. Navigate to Administration > Configuration > Search > XML Sitemap.
5. Select the Settings tab and there will be a Menu link field set. Open.
6. Choose the menu link to be edited. There will now be a XML sitemap horizontal
tab. Under "Inclusion" change "Excluded" to become "Included". Select Save.
7. Once that is all complete, go to Configuration > Search and Metadata > XML
Sitemap.
8. Select the Rebuild Links tab in the upper right.
9. Select on "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 select and confirm that pages have been
added.
MAINTAINERS
-----------
* Andrei Mateescu (amateescu) - https://www.drupal.org/u/amateescu
* 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[] = menu
files[] = xmlsitemap_menu.module
files[] = xmlsitemap_menu.install
files[] = xmlsitemap_menu.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

@@ -1,5 +1,10 @@
<?php
/**
* @file
* Main file for XML sitemap menu.
*/
/**
* Implements hook_entity_info_alter().
*
@@ -54,6 +59,9 @@ function xmlsitemap_menu_entity_info_alter(&$info) {
'process callback' => 'xmlsitemap_menu_xmlsitemap_process_menu_links',
),
);
if (!isset($info['menu_link']['bundle label'])) {
$info['menu_link']['bundle label'] = t('Menu');
}
}
}
@@ -87,7 +95,7 @@ function xmlsitemap_menu_xmlsitemap_index_links($limit) {
/**
* Process menu sitemap links.
*
* @param $mlids
* @param array $mlids
* An array of menu link IDs.
*/
function xmlsitemap_menu_xmlsitemap_process_menu_links(array $mlids, array $xmlsitemap = array()) {
@@ -122,19 +130,23 @@ function xmlsitemap_menu_form_menu_edit_menu_alter(&$form, $form_state) {
xmlsitemap_add_link_bundle_settings($form, $form_state, 'menu_link', $menu);
}
//function xmlsitemap_menu_form_menu_overview_form_alter(&$form, $form_state) {
// $form['#submit'][] = 'xmlsitemap_menu_menu_overview_form_submit';
//}
//
//function xmlsitemap_menu_menu_overview_form_submit($form, $form_state) {
// $mlids = array();
// foreach (element_children($form) as $mlid) {
// if (isset($form[$mlid]['#item'])) {
// $mlids[] = $form[$mlid]['#item']['mlid'];
// }
// }
// xmlsitemap_menu_xmlsitemap_process_menu_links($mlids);
//}
/**
* Example functions.
*
* Function xmlsitemap_menu_form_menu_overview_form_alter(&$form, $form_state) {
* $form['#submit'][] = 'xmlsitemap_menu_menu_overview_form_submit';
* }
*
* Function xmlsitemap_menu_menu_overview_form_submit($form, $form_state) {
* $mlids = array();
* foreach (element_children($form) as $mlid) {
* if (isset($form[$mlid]['#item'])) {
* $mlids[] = $form[$mlid]['#item']['mlid'];
* }
* }
* xmlsitemap_menu_xmlsitemap_process_menu_links($mlids);
* }
*/
/**
* Implements hook_form_FORM_ID_alter().
@@ -202,8 +214,9 @@ function xmlsitemap_menu_menu_link_insert(array $link) {
* @see hook_menu_link_alter()
*/
function xmlsitemap_menu_menu_link_update(array $link) {
//$link += array('xmlsitemap' => array());
//xmlsitemap_menu_xmlsitemap_process_menu_links(array($link['mlid']), $link['xmlsitemap']);
// $link += array('xmlsitemap' => array());
// @codingStandardsIgnoreLine
// xmlsitemap_menu_xmlsitemap_process_menu_links(array($link['mlid']), $link['xmlsitemap']);.
}
/**
@@ -213,7 +226,7 @@ function xmlsitemap_menu_menu_link_update(array $link) {
* hook is not always called if the user does not edit the core menu item
* fields.
*
* @see http://drupal.org/node/1013856
* @see https://www.drupal.org/node/1013856
*/
function xmlsitemap_menu_menu_link_alter(array &$link) {
if (!empty($link['mlid'])) {
@@ -232,7 +245,7 @@ function xmlsitemap_menu_menu_link_delete(array $link) {
/**
* Create a sitemap link from a menu item.
*
* @param $menu_item
* @param array $menu_item
* A loaded menu item.
*/
function xmlsitemap_menu_create_link(array $menu_item) {
@@ -262,6 +275,19 @@ function xmlsitemap_menu_create_link(array $menu_item) {
$menu_item['xmlsitemap']['access'] = $menu_item['access'] && !$menu_item['external'] && !$menu_item['hidden'];
$menu_item['xmlsitemap']['language'] = isset($menu_item['options']['langcode']) ? $menu_item['options']['langcode'] : LANGUAGE_NONE;
// Exclude menu items created for nodes that are added by xmlsitemap_node.
if ($menu_item['xmlsitemap']['access'] && $menu_item['router_path'] == 'node/%' && module_exists('xmlsitemap_node')) {
$node = node_load(substr($menu_item['link_path'], 5));
if ($node) {
if (empty($node->xmlsitemap)) {
xmlsitemap_node_create_link($node);
}
if ($node->xmlsitemap['status'] && $node->xmlsitemap['access']) {
$menu_item['xmlsitemap']['status'] = FALSE;
}
}
}
return $menu_item['xmlsitemap'];
}

View File

@@ -2,13 +2,35 @@
/**
* @file
* Unit tests for the xmlsitemap_menu module.
* Unit tests for the xmlsitemap_menu project..
*/
/**
* Menu Functional Test.
*/
class XMLSitemapMenuFunctionalTest extends XMLSitemapTestHelper {
/**
* Normal User.
*
* @var string
*
* @codingStandardsIgnoreStart
*/
protected $normal_user;
/**
* Menu Items.
*
* @var array
*/
protected $menu_items = array();
/**
* Get Info.
*
* @codingStandardsIgnoreEnd
*/
public static function getInfo() {
return array(
'name' => 'XML sitemap menu',
@@ -17,7 +39,10 @@ class XMLSitemapMenuFunctionalTest extends XMLSitemapTestHelper {
);
}
function setUp($modules = array()) {
/**
* Setup.
*/
public function setUp($modules = array()) {
$modules[] = 'xmlsitemap_menu';
$modules[] = 'menu';
parent::setUp($modules);
@@ -26,7 +51,10 @@ class XMLSitemapMenuFunctionalTest extends XMLSitemapTestHelper {
$this->normal_user = $this->drupalCreateUser(array('access content'));
}
function testMenuSettings() {
/**
* Menu Settings.
*/
public function testMenuSettings() {
$this->drupalLogin($this->admin_user);
$edit = array(
@@ -36,7 +64,6 @@ class XMLSitemapMenuFunctionalTest extends XMLSitemapTestHelper {
'xmlsitemap[priority]' => '1.0',
);
$this->drupalPost('admin/structure/menu/add', $edit, 'Save');
$menu = menu_load($edit['menu_name']);
$this->clickLink('Add link');
$edit = array(
@@ -47,4 +74,5 @@ class XMLSitemapMenuFunctionalTest extends XMLSitemapTestHelper {
);
$this->drupalPost(NULL, $edit, 'Save');
}
}