Commit a3295949 authored by pifagor's avatar pifagor Committed by pifagor

Issue #2957576 by pifagor, alex_optim: All links that have the "https" protocol change to 'http'

parent c30e0f90
......@@ -283,6 +283,7 @@ function xmlsitemap_sitemap_delete_form_submit($form, $form_state) {
* @see xmlsitemap_settings_form_validate()
*/
function xmlsitemap_settings_form($form, &$form_state) {
global $base_url;
$form['xmlsitemap_minimum_lifetime'] = array(
'#type' => 'select',
'#title' => t('Minimum sitemap lifetime'),
......@@ -380,7 +381,7 @@ function xmlsitemap_settings_form($form, &$form_state) {
$form['advanced']['xmlsitemap_base_url'] = array(
'#type' => 'textfield',
'#title' => t('Default base URL'),
'#default_value' => variable_get('xmlsitemap_base_url', $GLOBALS['base_url']),
'#default_value' => variable_get('xmlsitemap_base_url', $base_url),
'#size' => 30,
'#description' => t('This is the default base URL used for sitemaps and sitemap links.'),
'#required' => TRUE,
......@@ -866,7 +867,7 @@ function xmlsitemap_add_form_link_options(array &$form, $entity, $bundle, $id) {
// '#type' => 'value',
// '#value' => $node->xmlsitemap['changecount'],
// );
// @codingStandardsIgnoreEnd
// @codingStandardsIgnoreEnd
// Add the submit handler to adjust the default values if selected.
$form += array('#submit' => array());
if (!in_array('xmlsitemap_process_form_link_options', $form['#submit'])) {
......
......@@ -159,6 +159,7 @@ function xmlsitemap_generate_page(stdClass $sitemap, $page) {
* Generate chunk.
*/
function xmlsitemap_generate_chunk(stdClass $sitemap, XMLSitemapWriter $writer, $chunk) {
global $base_url;
$output_elements = drupal_map_assoc(variable_get('xmlsitemap_output_elements', array(
'lastmod',
'changefreq',
......@@ -169,7 +170,7 @@ function xmlsitemap_generate_chunk(stdClass $sitemap, XMLSitemapWriter $writer,
$url_options = $sitemap->uri['options'];
$url_options += array(
'absolute' => TRUE,
'base_url' => variable_get('xmlsitemap_base_url', $GLOBALS['base_url']),
'base_url' => variable_get('xmlsitemap_base_url', $base_url),
'language' => language_default(),
'alias' => variable_get('xmlsitemap_prefetch_aliases', TRUE),
);
......
......@@ -299,6 +299,7 @@ function xmlsitemap_robotstxt() {
* Internal default variables for xmlsitemap_var().
*/
function xmlsitemap_variables() {
global $base_url;
return array(
'xmlsitemap_rebuild_needed' => FALSE,
'xmlsitemap_regenerate_needed' => FALSE,
......@@ -309,7 +310,7 @@ function xmlsitemap_variables() {
'xmlsitemap_chunk_size' => 'auto',
'xmlsitemap_batch_limit' => 100,
'xmlsitemap_path' => 'xmlsitemap',
'xmlsitemap_base_url' => $GLOBALS['base_url'],
'xmlsitemap_base_url' => $base_url,
'xmlsitemap_developer_mode' => 0,
'xmlsitemap_frontpage_priority' => 1.0,
'xmlsitemap_frontpage_changefreq' => XMLSITEMAP_FREQUENCY_DAILY,
......@@ -550,12 +551,13 @@ function xmlsitemap_sitemap_get_context_hash(array &$context) {
* the XML sitemap, and matching the signature of url().
*/
function xmlsitemap_sitemap_uri(stdClass $sitemap) {
global $base_url;
$uri['path'] = 'sitemap.xml';
$uri['options'] = module_invoke_all('xmlsitemap_context_url_options', $sitemap->context);
drupal_alter('xmlsitemap_context_url_options', $uri['options'], $sitemap->context);
$uri['options'] += array(
'absolute' => TRUE,
'base_url' => variable_get('xmlsitemap_base_url', $GLOBALS['base_url']),
'base_url' => variable_get('xmlsitemap_base_url', $base_url),
);
return $uri;
}
......
......@@ -96,10 +96,11 @@ class XMLSitemapWriter extends XMLWriter {
* Get Sitemap URL.
*/
public function getSitemapUrl($path, array $options = array()) {
global $base_url;
$options += $this->sitemap->uri['options'];
$options += array(
'absolute' => TRUE,
'base_url' => variable_get('xmlsitemap_base_url', $GLOBALS['base_url']),
'base_url' => variable_get('xmlsitemap_base_url', $base_url),
'language' => language_default(),
'alias' => TRUE,
);
......@@ -115,7 +116,7 @@ class XMLSitemapWriter extends XMLWriter {
* @codingStandardsIgnoreStart
*/
public function writeXSL() {
// @codingStandardsIgnoreEnd
// @codingStandardsIgnoreEnd
$this->writePi('xml-stylesheet', 'type="text/xsl" href="' . $this->getSitemapUrl('sitemap.xsl', array('protocol_relative' => TRUE)) . '"');
$this->writeRaw(PHP_EOL);
}
......@@ -206,7 +207,7 @@ class XMLSitemapWriter extends XMLWriter {
/**
* Get URI.
*
* @codingStandardsIgnoreStart
* @codingStandardsIgnoreStart
*/
public function getURI() {
// @codingStandardsIgnoreEnd
......
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