Skip to content
Snippets Groups Projects
Commit c23c9691 authored by Jared Hancock's avatar Jared Hancock
Browse files

Fix image corruption on FAQ save

Fixes #198
parent 2f62149d
No related branches found
No related tags found
No related merge requests found
...@@ -78,7 +78,7 @@ class KbaseAjaxAPI extends AjaxController { ...@@ -78,7 +78,7 @@ class KbaseAjaxAPI extends AjaxController {
<hr> <hr>
<a href="faq.php?id=%d">View</a> | <a href="faq.php?id=%d">Attachments (%s)</a>', <a href="faq.php?id=%d">View</a> | <a href="faq.php?id=%d">Attachments (%s)</a>',
$faq->getQuestion(), $faq->getQuestion(),
$faq->getAnswer(), $faq->getAnswerWithImages(),
Format::db_daydatetime($faq->getUpdateDate()), Format::db_daydatetime($faq->getUpdateDate()),
$faq->getId(), $faq->getId(),
$faq->getId(), $faq->getId(),
......
...@@ -59,7 +59,8 @@ class FAQ { ...@@ -59,7 +59,8 @@ class FAQ {
function getHashtable() { return $this->ht; } function getHashtable() { return $this->ht; }
function getKeywords() { return $this->ht['keywords']; } function getKeywords() { return $this->ht['keywords']; }
function getQuestion() { return $this->ht['question']; } function getQuestion() { return $this->ht['question']; }
function getAnswer() { function getAnswer() { return $this->ht['answer']; }
function getAnswerWithImages() {
return Format::viewableImages($this->ht['answer'], ROOT_PATH.'image.php'); return Format::viewableImages($this->ht['answer'], ROOT_PATH.'image.php');
} }
function getNotes() { return $this->ht['notes']; } function getNotes() { return $this->ht['notes']; }
......
...@@ -15,7 +15,7 @@ $category=$faq->getCategory(); ...@@ -15,7 +15,7 @@ $category=$faq->getCategory();
<div style="float:right;text-align:right;padding-top:5px;padding-right:5px;"></div> <div style="float:right;text-align:right;padding-top:5px;padding-right:5px;"></div>
<div class="clear"></div> <div class="clear"></div>
<p> <p>
<?php echo Format::safe_html($faq->getAnswer()); ?> <?php echo Format::safe_html($faq->getAnswerWithImages()); ?>
</p> </p>
<p> <p>
<?php <?php
......
...@@ -24,7 +24,7 @@ if($thisstaff->canManageFAQ()) { ...@@ -24,7 +24,7 @@ if($thisstaff->canManageFAQ()) {
</div> </div>
<div class="clear"></div> <div class="clear"></div>
<div class="thread-body"> <div class="thread-body">
<?php echo $faq->getAnswer(); ?> <?php echo $faq->getAnswerWithImages(); ?>
</div> </div>
<div class="clear"></div> <div class="clear"></div>
<p> <p>
......
...@@ -9,7 +9,7 @@ if($faq){ ...@@ -9,7 +9,7 @@ if($faq){
$info=$faq->getHashtable(); $info=$faq->getHashtable();
$info['id']=$faq->getId(); $info['id']=$faq->getId();
$info['topics']=$faq->getHelpTopicsIds(); $info['topics']=$faq->getHelpTopicsIds();
$info['answer']=$faq->getAnswer(); $info['answer']=Format::viewableImages($faq->getAnswer());
$info['notes']=Format::viewableImages($faq->getNotes()); $info['notes']=Format::viewableImages($faq->getNotes());
$qstr='id='.$faq->getId(); $qstr='id='.$faq->getId();
}else { }else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment