Merge commit 'origin/core-1.0.0' into core
authorVincent Zanotti <vincent.zanotti@m4x.org>
Sat, 23 May 2009 21:07:18 +0000 (23:07 +0200)
committerVincent Zanotti <vincent.zanotti@m4x.org>
Sat, 23 May 2009 21:07:18 +0000 (23:07 +0200)
SECURITY [new file with mode: 0644]
classes/csvimporter.php

diff --git a/SECURITY b/SECURITY
new file mode 100644 (file)
index 0000000..47f39de
--- /dev/null
+++ b/SECURITY
@@ -0,0 +1,15 @@
+# List of security fixes that have been committed to the "core" branch.
+# This list is used to programmatically determine if a checkout of plat/al has
+# known vulnerabilities (which is useful for automatically disabling an unused
+# and unsafe checkout).
+#
+# In order to guarantee that only patched checkouts do have an updated SECURITY
+# file, updates of this file should be done within the same sommit that actually
+# fixes the security issue. Since the commit id is not known yet, it can be
+# replaced by '00000000', and updated later.
+#
+# Format: <date> <commit id> <commit description>
+# The commit id should refer to the id in the "core" branch, if the initial
+# commit in a version branch had another name.
+
+# Hurray! No security holes have been found yet :)
index 34c6c08..1b4258b 100644 (file)
@@ -64,12 +64,12 @@ class CSVImporter
         return true;
     }
 
-    private function getValue($line, $partial_ops, $key, $action)
+    static public function getValue($line, $key, $action, $relation = null)
     {
         if (@array_key_exists($action, $line)) {
             $value = $line[$action];
         } elseif (is_callable($action, false)) {
-            $value = call_user_func($action, $line, $partial_ops, $key);
+            $value = call_user_func($action, $line, $key, $relation);
         } else {
             $value = $action;
         }
@@ -83,7 +83,7 @@ class CSVImporter
     {
         $ops = array();
         foreach ($relation as $key=>$ref) {
-            $ops[$key] = $this->getValue($line, $ops, $key, $ref);
+            $ops[$key] = $this->getValue($line, $key, $ref, $relation);
         }
         return $ops;
     }
@@ -92,7 +92,7 @@ class CSVImporter
     {
         $ops = array();
         foreach ($relation as $key=>$ref) {
-            $value = $this->getValue($line, $ops, $key, $ref);
+            $value = $this->getValue($line, $key, $ref, $relation);
             if (!is_null($value) && $value != 'NULL') {
                 $value = "'" . addslashes($value) . "'";
             }