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

@@ -1,5 +1,10 @@
<?php
/**
* @file
* Main file for XML sitemap engines.
*/
/**
* Implements hook_hook_info().
*/
@@ -21,7 +26,7 @@ function xmlsitemap_engines_help($path, $arg) {
switch ($path) {
case 'admin/config/search/xmlsitemap/engines':
if (!module_exists('site_verify')) {
$output .= '<p>' . t('In order to verify site ownership with the search engines listed below, it is highly recommended to download and install the <a href="@site-verify">Site verification module</a>.', array('@site-verify' => 'http://drupal.org/project/site_verify')) . '</p>';
$output .= '<p>' . t('In order to verify site ownership with the search engines listed below, it is highly recommended to download and install the <a href="@site-verify">Site verification module</a>.', array('@site-verify' => 'https://www.drupal.org/project/site_verify')) . '</p>';
}
break;
}
@@ -41,12 +46,13 @@ function xmlsitemap_engines_menu() {
'type' => MENU_LOCAL_TASK,
'file' => 'xmlsitemap_engines.admin.inc',
);
//$items['admin/config/search/xmlsitemap/engines/submit'] = array(
// 'page callback' => 'xmlsitemap_engines_submit',
// 'access callback' => 'xmlsitemap_engines_submit_access',
// 'type' => MENU_CALLBACK,
//);
// @code
// $items['admin/config/search/xmlsitemap/engines/submit'] = array(
// 'page callback' => 'xmlsitemap_engines_submit',
// 'access callback' => 'xmlsitemap_engines_submit_access',
// 'type' => MENU_CALLBACK,
// );
// @endcode
return $items;
}
@@ -59,6 +65,9 @@ function xmlsitemap_engines_cron() {
}
}
/**
* Check if can submit.
*/
function xmlsitemap_engines_can_submit() {
// Skip if the site is offline since search engines will not be able to
// access the site's content.
@@ -73,16 +82,21 @@ function xmlsitemap_engines_can_submit() {
return TRUE;
}
/**
* Submit access.
*/
function xmlsitemap_engines_submit_access() {
if (!xmlsitemap_engines_can_submit()) {
return FALSE;
}
// Allow manual submissions to run.
//if ($_GET['q'] == 'admin/config/search/xmlsitemap/engines/submit' && user_access('administer xmlsitemap')) {
// return TRUE;
//}
// @code
// @codingStandardsIgnoreLine
// if ($_GET['q'] == 'admin/config/search/xmlsitemap/engines/submit' && user_access('administer xmlsitemap')) {
// return TRUE;
// }
// @endcode
$submit_updated = variable_get('xmlsitemap_engines_submit_updated', TRUE);
$submitted_last = variable_get('xmlsitemap_engines_submit_last', 0);
$minimum_lifetime = variable_get('xmlsitemap_engines_minimum_lifetime', 86400);
@@ -103,7 +117,7 @@ function xmlsitemap_engines_submit_access() {
/**
* Submit the sitemaps to all the specified search engines.
*
* @param $smids
* @param array $smids
* An optional array of XML sitemap IDs. If not provided, it will load all
* existing XML sitemaps.
*/
@@ -134,9 +148,9 @@ function xmlsitemap_engines_submit_engines(array $smids = array()) {
/**
* Submit the sitemaps to a specific URL.
*
* @param $url
* @param string $url
* The URL for sitemap submission.
* @param $sitemaps
* @param array $sitemaps
* An array of URLs of the sitemaps to submit.
*/
function xmlsitemap_engines_submit_sitemaps($url, array $sitemaps) {
@@ -151,9 +165,10 @@ function xmlsitemap_engines_submit_sitemaps($url, array $sitemaps) {
/**
* Replace valid tokens in the URL with their appropriate values.
*
* @param $url
* @param string $url
* An un-tokenized URL.
* @return
*
* @return string
* A tokenized URL.
*/
function xmlsitemap_engines_prepare_url($url, $sitemap) {
@@ -163,12 +178,9 @@ function xmlsitemap_engines_prepare_url($url, $sitemap) {
/**
* Returns information about supported search engines.
*
* @param $engine
* @param string $engine
* (optional) The engine to return information for. If omitted, information
* for all engines is returned.
* @param $reset
* (optional) Boolean whether to reset the static cache and do nothing. Only
* used for tests.
*
* @see hook_xmlsitemap_engines_info()
* @see hook_xmlsitemap_engines_info_alter()
@@ -205,13 +217,13 @@ function xmlsitemap_engines_get_engine_info($engine = NULL) {
function xmlsitemap_engines_xmlsitemap_engine_info() {
$engines['google'] = array(
'name' => t('Google'),
'url' => 'http://www.google.com/webmasters/tools/ping?sitemap=[sitemap]',
'help url' => 'http://www.google.com/support/webmasters/bin/answer.py?hl=en&answer=156184',
'url' => 'https://www.google.com/webmasters/tools/ping?sitemap=[sitemap]',
'help url' => 'https://www.google.com/support/webmasters/bin/answer.py?hl=en&answer=156184',
);
$engines['bing'] = array(
'name' => t('Bing'),
'url' => 'http://www.bing.com/webmaster/ping.aspx?siteMap=[sitemap]',
'help url' => 'http://www.bing.com/webmaster',
'url' => 'https://www.bing.com/webmaster/ping.aspx?siteMap=[sitemap]',
'help url' => 'https://www.bing.com/webmaster',
);
return $engines;
}