diff options
-rw-r--r-- | Zotlabs/Module/Import.php | 9 | ||||
-rw-r--r-- | include/text.php | 23 |
2 files changed, 32 insertions, 0 deletions
diff --git a/Zotlabs/Module/Import.php b/Zotlabs/Module/Import.php index 6016328a5..0daf28aa9 100644 --- a/Zotlabs/Module/Import.php +++ b/Zotlabs/Module/Import.php @@ -127,6 +127,15 @@ class Import extends \Zotlabs\Web\Controller { // // } + + // prevent incompatible osada or zap data from horking your database + + if(array_path_exists('compatibility/codebase',$data)) { + notice('Data export format is not compatible with this software'); + return; + } + + if($moving) $seize = 1; diff --git a/include/text.php b/include/text.php index 646bfe749..edd0f7a5a 100644 --- a/include/text.php +++ b/include/text.php @@ -3467,6 +3467,28 @@ function print_val($v) { } +function array_path_exists($str,$arr) { + + $ptr = $arr; + $search = explode('/', $str); + + if($search) { + foreach($search as $s) { + if(array_key_exists($s,$ptr)) { + $ptr = $ptr[$s]; + } + else { + return false; + } + } + return true; + } + + return false; + +} + + /** * @brief Generate a unique ID. * @@ -3482,3 +3504,4 @@ function new_uuid() { return $hash; } + |