summaryrefslogtreecommitdiff
path: root/inc/media.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2013-03-01 12:54:01 +0100
committerAndreas Gohr <andi@splitbrain.org>2013-03-01 12:54:01 +0100
commitadd8678f233ad74892a96444e3013e0465616200 (patch)
tree10af2fae55051b7ed710e64d462497d0f4161432 /inc/media.php
parent058fd09655df42c72f3c447e3b9561e4909e978d (diff)
downloadrpg-add8678f233ad74892a96444e3013e0465616200.tar.gz
rpg-add8678f233ad74892a96444e3013e0465616200.tar.bz2
alternative fix for FS#2734
Diffstat (limited to 'inc/media.php')
-rw-r--r--inc/media.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/inc/media.php b/inc/media.php
index db1ca0d57..501d170f3 100644
--- a/inc/media.php
+++ b/inc/media.php
@@ -83,6 +83,20 @@ function media_metasave($id,$auth,$data){
}
/**
+ * Check if a media item is public (eg, external URL or readable by @ALL)
+ *
+ * @author Andreas Gohr <andi@splitbrain.org>
+ * @param string $id the media ID or URL
+ * @return bool
+ */
+function media_ispublic($id){
+ if(preg_match('/^https?:\/\//i',$id)) return true;
+ $id = cleanID($id);
+ if(auth_aclcheck(getNS($id).':*', '', array()) >= AUTH_READ) return true;
+ return false;
+}
+
+/**
* Display the form to edit image meta data
*
* @author Andreas Gohr <andi@splitbrain.org>