diff --git a/composer.json b/composer.json
index 87e47f8..113feaa 100644
--- a/composer.json
+++ b/composer.json
@@ -1,4 +1,11 @@
{
+ "repositories": [
+ {
+ "type": "vcs",
+ "url": "https://github.com/Youpie/simple-html-dom"
+ }
+ ],
+
"config": {
"vendor-dir": "system/vendor/",
"optimize-autoloader": true,
@@ -11,7 +18,8 @@
"michelf/php-markdown": "1.*",
"suin/php-rss-writer": "1.*",
"kanti/hub-updater": "0.*",
- "jbroadway/urlify": "^1.0"
+ "jbroadway/urlify": "^1.0",
+ "simple-html-dom/simple-html-dom": "*"
},
"autoload": {
"files": [
diff --git a/system/admin/admin.php b/system/admin/admin.php
index e67880e..d7c3ea3 100644
--- a/system/admin/admin.php
+++ b/system/admin/admin.php
@@ -775,6 +775,7 @@ function migrate($title, $time, $tags, $content, $url, $user, $source)
} else {
$post_content = '' . "\n" . '' . "\n\n" . $content;
}
+
if (!empty($post_title) && !empty($post_tag) && !empty($post_url) && !empty($post_content)) {
$post_content = stripslashes($post_content);
@@ -788,8 +789,31 @@ function migrate($title, $time, $tags, $content, $url, $user, $source)
file_put_contents($dir . $filename, print_r($post_content, true));
}
save_tag_i18n($post_tag, $post_tagmd);
+ // import images
+ if(count($images) > 0) {
+ foreach ($images as $image_url) {
+ $imagefile = basename($image_url);
+ if(!@copy($image_url,'content/images/'.$imagefile))
+ {
+ $errors= error_get_last();
+ echo "COPY ERROR: ".$errors['type'];
+ echo "
\n".$errors['message'];
+ } else {
+ echo "$imagefile copied from remote!
\n";
+ // $images_imported++;
+ }
+ }
+ }
+
$redirect = site_url() . 'admin/clear-cache';
header("Location: $redirect");
+ } else {
+ echo "