Changeset 2941971
- Timestamp:
- 07/23/2023 04:57:24 AM (2 years ago)
- Location:
- unwrap-shortlinks/trunk
- Files:
-
- 2 edited
-
readme.md (modified) (4 diffs)
-
unwrap-shortlinks.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
unwrap-shortlinks/trunk/readme.md
r2877631 r2941971 1 1 # Unwrap Shortlinks 2 2 3 Stable tag: 0.3. 23 Stable tag: 0.3.3 4 4 Tags: urls, links, classicpress 5 Tested up to: 6. 25 Tested up to: 6.3 6 6 Contributors: Kelson 7 7 License: GPLv2 or later … … 21 21 * wp.me 22 22 * tmblr.co 23 * tinyurl.com24 23 * goo.gl 25 24 * dlvr.it … … 27 26 * qr.ae 28 27 * aka.ms 28 29 NOTE: tinyurl.com has been removed from the list because they are blocking automated requests. (See changelog) 29 30 30 31 ## Installation … … 60 61 ## Changelog 61 62 63 ### [0.3.3] 64 * tinyurl.com is screening requests using Cloudflare, and a simple curl request is no longer allowed through. Removing it from the list. 65 62 66 ### [0.3.2] - 2022-10-29 63 67 * Tested up through 6.1, clean up headers, no functional changes. -
unwrap-shortlinks/trunk/unwrap-shortlinks.php
r2807062 r2941971 4 4 Plugin URI: https://codeberg.org/kvibber/unwrap-shortlinks 5 5 Description: Follow shortened links (t.co, bit.ly, etc) and expand them so that your blog post will point directly to the destination. 6 Version: 0.3. 26 Version: 0.3.3 7 7 Requires at least: 3.0 8 8 Requires CP: 1.0 … … 17 17 18 18 function ktv_unwrap_shortlinks($content) { 19 preg_match_all('/\b(https?:\/\/(?:t\.co|bit\.ly|j\.mp|ow\.ly|is\.gd|trib\.al|buff\.ly|tmblr\.co|wp\.me| tinyurl\.com|goo\.gl|dlvr\.it|fb\.me|qr\.ae|aka\.ms)\/[^\s"\'<>]+)\b/', $content, $matches, PREG_PATTERN_ORDER);19 preg_match_all('/\b(https?:\/\/(?:t\.co|bit\.ly|j\.mp|ow\.ly|is\.gd|trib\.al|buff\.ly|tmblr\.co|wp\.me|goo\.gl|dlvr\.it|fb\.me|qr\.ae|aka\.ms)\/[^\s"\'<>]+)\b/', $content, $matches, PREG_PATTERN_ORDER); 20 20 foreach ($matches[1] as $link) { 21 21 $getlink = ktv_unwrap_shortlinks_replace($link, 5); … … 38 38 // TODO Is it also a redirector? Do we have iterations left? 39 39 // If so, try to follow that one! 40 if( $countdown > 0 && preg_match('/\b(https?:\/\/(?:t\.co|bit\.ly|j\.mp|ow\.ly|is\.gd|trib\.al|buff\.ly|tmblr\.co|wp\.me| tinyurl\.com|goo\.gl|dlvr\.it|fb\.me|qr\.ae|aka\.ms)\/[^\s"\'<>]+)\b/', $finalURL) ) {40 if( $countdown > 0 && preg_match('/\b(https?:\/\/(?:t\.co|bit\.ly|j\.mp|ow\.ly|is\.gd|trib\.al|buff\.ly|tmblr\.co|wp\.me|goo\.gl|dlvr\.it|fb\.me|qr\.ae|aka\.ms)\/[^\s"\'<>]+)\b/', $finalURL) ) { 41 41 return ktv_unwrap_shortlinks_replace($finalURL, $countdown - 1); 42 42 } else {
Note: See TracChangeset
for help on using the changeset viewer.