External Links - Version 6.8

Version Description

  • Change: Handle links that space multiple lines (props archon810)
  • Fix: Add url found in a tag with a data- attribute prefix to the Auto convert Text Urls exclusion list (Fixes problem with addtoany)
  • Fix: Do not convert text urls found in schema.org meta and div tags
  • Fix: Do not convert text urls found in svg xlmns attributes
  • Fix: Remove strpos(): Empty needle PHP warning in sem-external-links.php (props archon810)
  • Under Hood: Tested with PHP 7.x
Download this release

Release Info

Developer Mike_Koepke
Plugin Icon wp plugin External Links
Version 6.8
Comparing to
See all releases

Code changes from version 6.7 to 6.8

Files changed (4) hide show
  1. composer.json +6 -0
  2. readme.txt +10 -1
  3. sem-autolink-uri.php +5 -2
  4. sem-external-links.php +7 -5
composer.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ {
2
+ "name": "semiologic/sem-external-links",
3
+ "description": "External Links",
4
+ "type": "wordpress-plugin",
5
+ "require": {}
6
+ }
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: Denis-de-Bernardy, Mike_Koepke
3
  Donate link: https://www.semiologic.com/donate/
4
  Tags: external-links, nofollow, link-target, link-icon, semiologic
5
  Requires at least: 2.8
6
- Tested up to: 4.3
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -59,6 +59,15 @@ The plugin supports a non-started rel="follow" attribute on links to override th
59
 
60
  == Change Log ==
61
 
 
 
 
 
 
 
 
 
 
62
  = 6.7 =
63
 
64
  - Fix: Some links with affiliate code may not be correctly detected as an external link.
3
  Donate link: https://www.semiologic.com/donate/
4
  Tags: external-links, nofollow, link-target, link-icon, semiologic
5
  Requires at least: 2.8
6
+ Tested up to: 4.7.3
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
59
 
60
  == Change Log ==
61
 
62
+ = 6.8 =
63
+
64
+ - Change: Handle links that space multiple lines (props archon810)
65
+ - Fix: Add url found in a tag with a data- attribute prefix to the Auto convert Text Urls exclusion list (Fixes problem with addtoany)
66
+ - Fix: Do not convert text urls found in schema.org meta and div tags
67
+ - Fix: Do not convert text urls found in svg xlmns attributes
68
+ - Fix: Remove strpos(): Empty needle PHP warning in sem-external-links.php (props archon810)
69
+ - Under Hood: Tested with PHP 7.x
70
+
71
  = 6.7 =
72
 
73
  - Fix: Some links with affiliate code may not be correctly detected as an external link.
sem-autolink-uri.php CHANGED
@@ -132,7 +132,7 @@ class sem_autolink_uri {
132
  )
133
  (?![\"']))
134
  /ix", array($this, 'url_callback'), $text);
135
-
136
  $text = sem_autolink_uri::unescape($text);
137
 
138
  return $text;
@@ -184,11 +184,14 @@ class sem_autolink_uri {
184
  'smart_links' => "/
185
  \[.+?\]
186
  /x",
 
 
 
187
  'anchors' => "/
188
  <a .*?>.*?<\/a>
189
  /isx",
190
  'tags' => "/
191
- <[^<>]+?(?:src|href|codebase|archive|usemap|data|value|action|background|placeholder|onclick)=[^<>]+?>
192
  /ix",
193
  ) as $regex ) {
194
  $t = preg_replace_callback($regex, array($this, 'escape_callback'), $text);
132
  )
133
  (?![\"']))
134
  /ix", array($this, 'url_callback'), $text);
135
+
136
  $text = sem_autolink_uri::unescape($text);
137
 
138
  return $text;
184
  'smart_links' => "/
185
  \[.+?\]
186
  /x",
187
+ 'meta' => "/
188
+ <meta .*?>
189
+ /isx",
190
  'anchors' => "/
191
  <a .*?>.*?<\/a>
192
  /isx",
193
  'tags' => "/
194
+ <[^<>]+?(?:src|href|codebase|archive|usemap|data|data-.*|itemtype|xmlns|value|action|background|placeholder|onclick)=[^<>]+?>
195
  /ix",
196
  ) as $regex ) {
197
  $t = preg_replace_callback($regex, array($this, 'escape_callback'), $text);
sem-external-links.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: External Links
4
  Plugin URI: http://www.semiologic.com/software/external-links/
5
  Description: Marks outbound links as such, with various effects that are configurable under <a href="options-general.php?page=external-links">Settings / External Links</a>.
6
- Version: 6.7
7
  Author: Denis de Bernardy & Mike Koepke
8
  Author URI: https://www.semiologic.com
9
  Text Domain: sem-external-links
@@ -19,7 +19,7 @@ This software is copyright Denis de Bernardy & Mike Koepke, and is distributed u
19
 
20
  **/
21
 
22
- define('sem_external_links_version', '6.6');
23
 
24
  /**
25
  * external_links
@@ -449,7 +449,7 @@ class sem_external_links {
449
  $attr_value = false;
450
  $quote = false; // quotes to wrap attribute values
451
 
452
- preg_match('/(<a.*>)/iU', $html, $match);
453
 
454
  $link_str = $match[1];
455
  if ($link_str == "")
@@ -724,7 +724,9 @@ class sem_external_links {
724
  $subdomains = $domain;
725
  $domain = $this->extract_domain($subdomains);
726
 
727
- $subdomains = rtrim( substr($subdomains, 0, strpos($subdomains, $domain)) );
 
 
728
 
729
  return $subdomains;
730
  } # extract_subdomains()
@@ -877,4 +879,4 @@ class sem_external_links {
877
 
878
  } # external_links
879
 
880
- $sem_external_links = sem_external_links::get_instance();
3
  Plugin Name: External Links
4
  Plugin URI: http://www.semiologic.com/software/external-links/
5
  Description: Marks outbound links as such, with various effects that are configurable under <a href="options-general.php?page=external-links">Settings / External Links</a>.
6
+ Version: 6.8
7
  Author: Denis de Bernardy & Mike Koepke
8
  Author URI: https://www.semiologic.com
9
  Text Domain: sem-external-links
19
 
20
  **/
21
 
22
+ define('sem_external_links_version', '6.8');
23
 
24
  /**
25
  * external_links
449
  $attr_value = false;
450
  $quote = false; // quotes to wrap attribute values
451
 
452
+ preg_match('/(<a.*>)/isU', $html, $match);
453
 
454
  $link_str = $match[1];
455
  if ($link_str == "")
724
  $subdomains = $domain;
725
  $domain = $this->extract_domain($subdomains);
726
 
727
+ if(!empty($domain)){
728
+ $subdomains = rtrim( substr($subdomains, 0, strpos($subdomains, $domain)) );
729
+ }
730
 
731
  return $subdomains;
732
  } # extract_subdomains()
879
 
880
  } # external_links
881
 
882
+ $sem_external_links = sem_external_links::get_instance();