summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorKlap-in <klapinklapin@gmail.com>2013-05-21 22:52:10 +0200
committerKlap-in <klapinklapin@gmail.com>2013-05-21 22:52:10 +0200
commit3e7e6067571e660cd835164c22d0973aa6343408 (patch)
treef8fec56e64a37035bab3db67ce39a6c247de7531 /inc
parent5287f99cf079142a71032cbbfaffbd32a5bd6f3d (diff)
downloadrpg-3e7e6067571e660cd835164c22d0973aa6343408.tar.gz
rpg-3e7e6067571e660cd835164c22d0973aa6343408.tar.bz2
apply media_isexternal
Diffstat (limited to 'inc')
-rw-r--r--inc/Mailer.class.php2
-rw-r--r--inc/fetch.functions.php2
-rw-r--r--inc/fulltext.php2
-rw-r--r--inc/parser/handler.php2
-rw-r--r--inc/parser/metadata.php2
5 files changed, 5 insertions, 5 deletions
diff --git a/inc/Mailer.class.php b/inc/Mailer.class.php
index f87d7dd84..cb5f22f54 100644
--- a/inc/Mailer.class.php
+++ b/inc/Mailer.class.php
@@ -192,7 +192,7 @@ class Mailer {
// copy over all replacements missing for HTML (autolink URLs)
foreach($textrep as $key => $value) {
if(isset($htmlrep[$key])) continue;
- if(preg_match('/^https?:\/\//i', $value)) {
+ if(media_isexternal($value)) {
$htmlrep[$key] = '<a href="'.hsc($value).'">'.hsc($value).'</a>';
} else {
$htmlrep[$key] = hsc($value);
diff --git a/inc/fetch.functions.php b/inc/fetch.functions.php
index 56ca75465..e78bbf103 100644
--- a/inc/fetch.functions.php
+++ b/inc/fetch.functions.php
@@ -100,7 +100,7 @@ function checkFileStatus(&$media, &$file, $rev = '', $width=0, $height=0) {
global $MIME, $EXT, $CACHE, $INPUT;
//media to local file
- if(preg_match('#^(https?|ftp)://#i', $media)) {
+ if(media_isexternal($media)) {
//check hash
if(substr(md5(auth_cookiesalt().$media), 0, 6) !== $INPUT->str('hash')) {
return array(412, 'Precondition Failed');
diff --git a/inc/fulltext.php b/inc/fulltext.php
index 7ee386063..2f073acea 100644
--- a/inc/fulltext.php
+++ b/inc/fulltext.php
@@ -172,7 +172,7 @@ function ft_mediause($id,$max){
preg_match_all('/\{\{([^|}]*'.$pcre.'[^|}]*)(|[^}]+)?\}\}/i',rawWiki($doc),$matches);
foreach($matches[1] as $img){
$img = trim($img);
- if(preg_match('/^https?:\/\//i',$img)) continue; // skip external images
+ if(media_isexternal($img)) continue; // skip external images
list($img) = explode('?',$img); // remove any parameters
resolve_mediaid($ns,$img,$exists); // resolve the possibly relative img
diff --git a/inc/parser/handler.php b/inc/parser/handler.php
index 55b715ad9..1cf32aaed 100644
--- a/inc/parser/handler.php
+++ b/inc/parser/handler.php
@@ -680,7 +680,7 @@ function Doku_Handler_Parse_Media($match) {
}
// Check whether this is a local or remote image
- if ( preg_match('#^(https?|ftp)#i',$src) ) {
+ if ( media_isexternal($src) ) {
$call = 'externalmedia';
} else {
$call = 'internalmedia';
diff --git a/inc/parser/metadata.php b/inc/parser/metadata.php
index 8638ffa6a..e17b82f8b 100644
--- a/inc/parser/metadata.php
+++ b/inc/parser/metadata.php
@@ -432,7 +432,7 @@ class Doku_Renderer_metadata extends Doku_Renderer {
global $ID;
list($src,$hash) = explode('#',$src,2);
- if(!preg_match('/^https?:\/\//i',$src)){
+ if(!media_isexternal($src)){
resolve_mediaid(getNS($ID),$src, $exists);
}
if(preg_match('/.(jpe?g|gif|png)$/i',$src)){