projects
/
horde.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f86fc0d
)
Add Horde_Mime::isChild()
author
Michael M Slusarz
<slusarz@curecanti.org>
Mon, 9 Nov 2009 20:42:37 +0000
(13:42 -0700)
committer
Michael M Slusarz
<slusarz@curecanti.org>
Tue, 10 Nov 2009 16:51:23 +0000
(09:51 -0700)
framework/Mime/lib/Horde/Mime.php
patch
|
blob
|
history
diff --git
a/framework/Mime/lib/Horde/Mime.php
b/framework/Mime/lib/Horde/Mime.php
index
9f9afce
..
211a229
100644
(file)
--- a/
framework/Mime/lib/Horde/Mime.php
+++ b/
framework/Mime/lib/Horde/Mime.php
@@
-669,6
+669,20
@@
class Horde_Mime
}
/**
+ * Determines if a given MIME ID lives underneath a base ID.
+ *
+ * @param string $base The base MIME ID.
+ * @param string $id The MIME ID to query.
+ *
+ * @return boolean Whether $id lives underneath $base.
+ */
+ static public function isChild($base, $id)
+ {
+ return ((($base == 0) && ($id != 0)) ||
+ strpos(strval($id), strval($base)) === 0);
+ }
+
+ /**
* Scans $input for uuencoded data and converts it to unencoded data.
*
* @param string $input The input data