SEOPress - Version 2.9.2

Version Description

  • FIX Encoding some characters in xml image sitemaps & og:image
Download this release

Release Info

Developer rainbowgeek
Plugin Icon 128x128 SEOPress
Version 2.9.2
Comparing to
See all releases

Code changes from version 2.9.1 to 2.9.2

inc/functions/options-social.php CHANGED
@@ -602,7 +602,7 @@ function seopress_thumbnail_in_content() {
602
  //DomDocument
603
  $dom = new domDocument;
604
  $internalErrors = libxml_use_internal_errors(true);
605
- $dom->loadHTML($seopress_get_the_content);
606
  $dom->preserveWhiteSpace = false;
607
  $domxpath = new DOMXPath($dom);
608
 
@@ -611,7 +611,7 @@ function seopress_thumbnail_in_content() {
611
 
612
  if (!empty($imgs) && $imgs[0] !=NULL) {
613
  $url = $imgs[0]->getAttribute('src');
614
- $url = esc_attr(wp_filter_nohtml_kses(htmlentities($url)));
615
  return $url;
616
  }
617
  libxml_use_internal_errors($internalErrors);
602
  //DomDocument
603
  $dom = new domDocument;
604
  $internalErrors = libxml_use_internal_errors(true);
605
+ $dom->loadHTML(mb_convert_encoding($seopress_get_the_content, 'HTML-ENTITIES', 'UTF-8'));
606
  $dom->preserveWhiteSpace = false;
607
  $domxpath = new DOMXPath($dom);
608
 
611
 
612
  if (!empty($imgs) && $imgs[0] !=NULL) {
613
  $url = $imgs[0]->getAttribute('src');
614
+ $url = esc_attr(wp_filter_nohtml_kses($url));
615
  return $url;
616
  }
617
  libxml_use_internal_errors($internalErrors);
inc/functions/sitemap/template-xml-sitemaps-single.php CHANGED
@@ -76,7 +76,7 @@ function seopress_xml_sitemap_single() {
76
  if (get_post_field('post_content', $post) !='') {
77
  $dom = new domDocument;
78
  $internalErrors = libxml_use_internal_errors(true);
79
- $dom->loadHTML(get_post_field('post_content', $post));
80
  $dom->preserveWhiteSpace = false;
81
  if ($dom->getElementsByTagName('img') !='') {
82
  $images = $dom->getElementsByTagName('img');
@@ -113,7 +113,7 @@ function seopress_xml_sitemap_single() {
113
  $seopress_sitemaps .= '<image:image>';
114
  $seopress_sitemaps .= "\n";
115
  $seopress_sitemaps .= '<image:loc>';
116
- $seopress_sitemaps .= '<![CDATA['.utf8_decode(urldecode(esc_attr(wp_filter_nohtml_kses(htmlentities($url))))).']]>';
117
  $seopress_sitemaps .= '</image:loc>';
118
  $seopress_sitemaps .= "\n";
119
  $seopress_sitemaps .= '</image:image>';
@@ -132,7 +132,7 @@ function seopress_xml_sitemap_single() {
132
  $seopress_sitemaps .= '<image:image>';
133
  $seopress_sitemaps .= "\n";
134
  $seopress_sitemaps .= '<image:loc>';
135
- $seopress_sitemaps .= '<![CDATA['.utf8_decode(urldecode(esc_attr(wp_filter_nohtml_kses(htmlentities($url))))).']]>';
136
  $seopress_sitemaps .= '</image:loc>';
137
  $seopress_sitemaps .= "\n";
138
  $seopress_sitemaps .= '</image:image>';
76
  if (get_post_field('post_content', $post) !='') {
77
  $dom = new domDocument;
78
  $internalErrors = libxml_use_internal_errors(true);
79
+ $dom->loadHTML(mb_convert_encoding(get_post_field('post_content', $post), 'HTML-ENTITIES', 'UTF-8'));
80
  $dom->preserveWhiteSpace = false;
81
  if ($dom->getElementsByTagName('img') !='') {
82
  $images = $dom->getElementsByTagName('img');
113
  $seopress_sitemaps .= '<image:image>';
114
  $seopress_sitemaps .= "\n";
115
  $seopress_sitemaps .= '<image:loc>';
116
+ $seopress_sitemaps .= '<![CDATA['.urldecode(esc_attr(wp_filter_nohtml_kses($url))).']]>';
117
  $seopress_sitemaps .= '</image:loc>';
118
  $seopress_sitemaps .= "\n";
119
  $seopress_sitemaps .= '</image:image>';
132
  $seopress_sitemaps .= '<image:image>';
133
  $seopress_sitemaps .= "\n";
134
  $seopress_sitemaps .= '<image:loc>';
135
+ $seopress_sitemaps .= '<![CDATA['.urldecode(esc_attr(wp_filter_nohtml_kses(htmlentities($url)))).']]>';
136
  $seopress_sitemaps .= '</image:loc>';
137
  $seopress_sitemaps .= "\n";
138
  $seopress_sitemaps .= '</image:image>';
languages/wp-seopress-fr_FR.mo CHANGED
Binary file
languages/wp-seopress-fr_FR.po CHANGED
@@ -2,8 +2,8 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: SEOPress\n"
4
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/wp-cloudy\n"
5
- "POT-Creation-Date: 2018-06-06 22:04+0200\n"
6
- "PO-Revision-Date: 2018-06-06 22:04+0200\n"
7
  "Last-Translator: \n"
8
  "Language-Team: Benjamin DENIS <contact@seopress.org>\n"
9
  "Language: fr_FR\n"
2
  msgstr ""
3
  "Project-Id-Version: SEOPress\n"
4
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/wp-cloudy\n"
5
+ "POT-Creation-Date: 2018-06-11 19:59+0200\n"
6
+ "PO-Revision-Date: 2018-06-11 19:59+0200\n"
7
  "Last-Translator: \n"
8
  "Language-Team: Benjamin DENIS <contact@seopress.org>\n"
9
  "Language: fr_FR\n"
readme.txt CHANGED
@@ -6,7 +6,7 @@ Tags: seo, search engine optimization, meta title, open graph, content analysis,
6
  Requires at least: 4.4+
7
  Tested up to: 4.9
8
  Requires PHP: 5.4
9
- Stable tag: 2.9.1
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
@@ -159,6 +159,8 @@ Subscribe on <a href="https://www.seopress.org/" target="_blank">seopress.org</a
159
  44. Structured Data Types metaboxe in post, page, custom post type (PRO)
160
 
161
  == Changelog ==
 
 
162
  = 2.9.1 =
163
  * FIX og:image
164
  = 2.9 =
6
  Requires at least: 4.4+
7
  Tested up to: 4.9
8
  Requires PHP: 5.4
9
+ Stable tag: 2.9.2
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
159
  44. Structured Data Types metaboxe in post, page, custom post type (PRO)
160
 
161
  == Changelog ==
162
+ = 2.9.2 =
163
+ * FIX Encoding some characters in xml image sitemaps & og:image
164
  = 2.9.1 =
165
  * FIX og:image
166
  = 2.9 =
seopress.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: SEOPress
4
  Plugin URI: https://www.seopress.org/
5
  Description: The best SEO plugin.
6
- Version: 2.9.1
7
  Author: Benjamin DENIS
8
  Author URI: https://www.seopress.org/
9
  License: GPLv2
@@ -55,7 +55,7 @@ register_deactivation_hook(__FILE__, 'seopress_deactivation');
55
  //Define
56
  ///////////////////////////////////////////////////////////////////////////////////////////////////
57
 
58
- define( 'SEOPRESS_VERSION', '2.9.1' );
59
  define( 'SEOPRESS_AUTHOR', 'Benjamin Denis' );
60
 
61
  ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -560,10 +560,7 @@ function seopress_get_toggle_advanced_option() {
560
  // Test abolute URLs (return true if absolute)
561
  ///////////////////////////////////////////////////////////////////////////////////////////////////
562
  function seopress_is_absolute($url) {
563
- $pattern = "/^(?:ftp|https?|feed)?:?\/\/(?:(?:(?:[\w\.\-\+!$&'\(\)*\+,;=]|%[0-9a-f]{2})+:)*
564
- (?:[\w\.\-\+%!$&'\(\)*\+,;=]|%[0-9a-f]{2})+@)?(?:
565
- (?:[a-z0-9\-\.]|%[0-9a-f]{2})+|(?:\[(?:[0-9a-f]{0,4}:)*(?:[0-9a-f]{0,4})\]))(?::[0-9]+)?(?:[\/|\?]
566
- (?:[\w#!:\.\?\+\|=&@$'~*,;\/\(\)\[\]\-]|%[0-9a-f]{2})*)?$/xi";
567
 
568
  return (bool) preg_match($pattern, $url);
569
  }
3
  Plugin Name: SEOPress
4
  Plugin URI: https://www.seopress.org/
5
  Description: The best SEO plugin.
6
+ Version: 2.9.2
7
  Author: Benjamin DENIS
8
  Author URI: https://www.seopress.org/
9
  License: GPLv2
55
  //Define
56
  ///////////////////////////////////////////////////////////////////////////////////////////////////
57
 
58
+ define( 'SEOPRESS_VERSION', '2.9.2' );
59
  define( 'SEOPRESS_AUTHOR', 'Benjamin Denis' );
60
 
61
  ///////////////////////////////////////////////////////////////////////////////////////////////////
560
  // Test abolute URLs (return true if absolute)
561
  ///////////////////////////////////////////////////////////////////////////////////////////////////
562
  function seopress_is_absolute($url) {
563
+ $pattern = "%^(?:(?:https?|ftp)://)(?:\S+(?::\S*)?@|\d{1,3}(?:\.\d{1,3}){3}|(?:(?:[a-z\d\x{00a1}-\x{ffff}]+-?)*[a-z\d\x{00a1}-\x{ffff}]+)(?:\.(?:[a-z\d\x{00a1}-\x{ffff}]+-?)*[a-z\d\x{00a1}-\x{ffff}]+)*(?:\.[a-z\x{00a1}-\x{ffff}]{2,6}))(?::\d+)?(?:[^\s]*)?$%iu";
 
 
 
564
 
565
  return (bool) preg_match($pattern, $url);
566
  }