summaryrefslogtreecommitdiff
path: root/modules/rdf/rdf.module
diff options
context:
space:
mode:
Diffstat (limited to 'modules/rdf/rdf.module')
-rw-r--r--modules/rdf/rdf.module13
1 files changed, 6 insertions, 7 deletions
diff --git a/modules/rdf/rdf.module b/modules/rdf/rdf.module
index 59dc541f9..aa7653d18 100644
--- a/modules/rdf/rdf.module
+++ b/modules/rdf/rdf.module
@@ -236,14 +236,13 @@ function rdf_rdfa_attributes($mapping, $data = NULL) {
// literal text.
case 'property':
$attributes['property'] = $mapping['predicates'];
- if (isset($mapping['callback']) && isset($data)) {
+ // Convert $data to a specific format as per the callback function.
+ if (isset($data) && isset($mapping['callback']) && function_exists($mapping['callback'])) {
$callback = $mapping['callback'];
- if (function_exists($callback)) {
- $attributes['content'] = $callback($data);
- }
- if (isset($mapping['datatype'])) {
- $attributes['datatype'] = $mapping['datatype'];
- }
+ $attributes['content'] = $callback($data);
+ }
+ if (isset($mapping['datatype'])) {
+ $attributes['datatype'] = $mapping['datatype'];
}
break;
}