]> git.mjollnir.org Git - moodle.git/commitdiff
onespace2empty() needs to be in legacy dmllib() until we kill all
authorstronk7 <stronk7>
Sun, 25 May 2008 02:32:30 +0000 (02:32 +0000)
committerstronk7 <stronk7>
Sun, 25 May 2008 02:32:30 +0000 (02:32 +0000)
usages of legacy dmllib functions

lib/dmllib_todo.php

index 94ebc2619203fd4dcaf9e8b8412685eb6f25107f..a4fbb097325085fb77d4d54aa79a8e0e1ddb4c2b 100644 (file)
@@ -1296,4 +1296,18 @@ error('todo');
     return $status;
 }
 
+/**
+ * This function is used to convert all the Oracle 1-space defaults to the empty string
+ * like a really DIRTY HACK to allow it to work better until all those NOT NULL DEFAULT ''
+ * fields will be out from Moodle.
+ * @param string the string to be converted to '' (empty string) if it's ' ' (one space)
+ * @param mixed the key of the array in case we are using this function from array_walk,
+ *              defaults to null for other (direct) uses
+ * @return boolean always true (the converted variable is returned by reference)
+ */
+ function onespace2empty(&$item, $key=null) {
+     $item = $item == ' ' ? '' : $item;
+     return true;
+ }
+
 ?>