diff --git a/objects/functions.php b/objects/functions.php
index 6de0b028ba..4e96b9b876 100644
--- a/objects/functions.php
+++ b/objects/functions.php
@@ -2592,9 +2592,9 @@ function siteMap() {
' . Video::getLink($video['id'], $video['clean_title']) . '
' . $img . '
- ' . str_replace('"', '', $video['title']) . '
-
- ' . htmlentities(parseVideos(Video::getLinkToVideo($videos_id))) . '
+
+
+
' . $duration . '
' . $video['views_count'] . '
' . date("Y-m-d\TH:i:s", strtotime($video['created'])) . '+00:00
@@ -2613,27 +2613,30 @@ function siteMap() {
_error_log("siteMap: pregreplace1 fail ");
$newXML1 = $xml;
}
- $newXML2 = preg_replace('/&(?!#?[a-z0-9]+;)/', '&', $newXML1);
- if (empty($newXML2)) {
- _error_log("siteMap: pregreplace2 fail ");
- $newXML2 = $newXML1;
+ if(!empty($advancedCustom->siteMapUTF8Fix)){
+ $newXML2 = preg_replace('/&(?!#?[a-z0-9]+;)/', '&', $newXML1);
+ if (empty($newXML2)) {
+ _error_log("siteMap: pregreplace2 fail ");
+ $newXML2 = $newXML1;
+ }
+ $newXML3 = preg_replace('/[\x00-\x1F\x7F-\xFF]/', '', $newXML2);
+ if (empty($newXML3)) {
+ _error_log("siteMap: pregreplace3 fail ");
+ $newXML3 = $newXML2;
+ }
+ $newXML4 = preg_replace('/[\x00-\x1F\x7F]/', '', $newXML3);
+ if (empty($newXML4)) {
+ _error_log("siteMap: pregreplace4 fail ");
+ $newXML4 = $newXML3;
+ }
+ $newXML5 = preg_replace('/[\x00-\x1F\x7F\xA0]/u', '', $newXML4);
+ if (empty($newXML5)) {
+ _error_log("siteMap: pregreplace5 fail ");
+ $newXML5 = $newXML4;
+ }
+ }else{
+ $newXML5 = $newXML1;
}
- $newXML3 = preg_replace('/[\x00-\x1F\x7F-\xFF]/', '', $newXML2);
- if (empty($newXML3)) {
- _error_log("siteMap: pregreplace3 fail ");
- $newXML3 = $newXML2;
- }
- $newXML4 = preg_replace('/[\x00-\x1F\x7F]/', '', $newXML3);
- if (empty($newXML4)) {
- _error_log("siteMap: pregreplace4 fail ");
- $newXML4 = $newXML3;
- }
- $newXML5 = preg_replace('/[\x00-\x1F\x7F\xA0]/u', '', $newXML4);
- if (empty($newXML5)) {
- _error_log("siteMap: pregreplace5 fail ");
- $newXML5 = $newXML4;
- }
-
return $newXML5;
}
diff --git a/plugin/CustomizeAdvanced/CustomizeAdvanced.php b/plugin/CustomizeAdvanced/CustomizeAdvanced.php
index c7e24c20e5..86324e82e5 100644
--- a/plugin/CustomizeAdvanced/CustomizeAdvanced.php
+++ b/plugin/CustomizeAdvanced/CustomizeAdvanced.php
@@ -173,6 +173,7 @@ class CustomizeAdvanced extends PluginAbstract {
$o->value = "";
$obj->videoNotFoundText = $o;
$obj->siteMapRowsLimit = 100;
+ $obj->siteMapUTF8Fix = false;
$obj->showPrivateVideosOnSitemap = false;
$obj->enableOldPassHashCheck = true;
$obj->disableHTMLDescription = false;