mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
correct logic, add missing permalink creator
This commit is contained in:
@ -63,6 +63,7 @@ class ImportScripts::Lithium < ImportScripts::Base
|
|||||||
import_accepted_answers
|
import_accepted_answers
|
||||||
import_pms
|
import_pms
|
||||||
close_topics
|
close_topics
|
||||||
|
create_permalinks
|
||||||
|
|
||||||
post_process_posts
|
post_process_posts
|
||||||
end
|
end
|
||||||
@ -728,9 +729,6 @@ SQL
|
|||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_markdown(html)
|
|
||||||
end
|
|
||||||
|
|
||||||
def post_process_posts
|
def post_process_posts
|
||||||
puts "", "Postprocessing posts..."
|
puts "", "Postprocessing posts..."
|
||||||
|
|
||||||
@ -773,15 +771,16 @@ SQL
|
|||||||
|
|
||||||
# we need an upload here
|
# we need an upload here
|
||||||
upload_name = $1 if uri.path =~ /image-id\/([^\/]+)/
|
upload_name = $1 if uri.path =~ /image-id\/([^\/]+)/
|
||||||
|
if upload_name
|
||||||
|
png = UPLOAD_DIR + "/" + upload_name + ".png"
|
||||||
|
jpg = UPLOAD_DIR + "/" + upload_name + ".jpg"
|
||||||
|
|
||||||
png = UPLOAD_DIR + "/" + upload_name + ".png"
|
# check to see if we have it
|
||||||
jpg = UPLOAD_DIR + "/" + upload_name + ".jpg"
|
if File.exist?(png)
|
||||||
|
image = png
|
||||||
# check to see if we have it
|
elsif File.exists?(jpg)
|
||||||
if File.exist?(png)
|
image = jpg
|
||||||
image = png
|
end
|
||||||
elsif File.exists?(jpg)
|
|
||||||
image = jpg
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if image
|
if image
|
||||||
|
Reference in New Issue
Block a user