Skip to content
Snippets Groups Projects
Commit 7b816ac3 authored by Peter Rotich's avatar Peter Rotich
Browse files

Merge pull request #199 from greezybacon/issue/198


Fix image corruption on FAQ save

Reviewed-By: default avatarPeter Rotich <peter@osticket.com>
parents 2f62149d f8d731c8
No related branches found
No related tags found
No related merge requests found
......@@ -78,7 +78,7 @@ class KbaseAjaxAPI extends AjaxController {
<hr>
<a href="faq.php?id=%d">View</a> | <a href="faq.php?id=%d">Attachments (%s)</a>',
$faq->getQuestion(),
$faq->getAnswer(),
$faq->getAnswerWithImages(),
Format::db_daydatetime($faq->getUpdateDate()),
$faq->getId(),
$faq->getId(),
......
......@@ -59,7 +59,8 @@ class FAQ {
function getHashtable() { return $this->ht; }
function getKeywords() { return $this->ht['keywords']; }
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');
}
function getNotes() { return $this->ht['notes']; }
......
......@@ -15,7 +15,7 @@ $category=$faq->getCategory();
<div style="float:right;text-align:right;padding-top:5px;padding-right:5px;"></div>
<div class="clear"></div>
<p>
<?php echo Format::safe_html($faq->getAnswer()); ?>
<?php echo Format::safe_html($faq->getAnswerWithImages()); ?>
</p>
<p>
<?php
......
......@@ -24,7 +24,7 @@ if($thisstaff->canManageFAQ()) {
</div>
<div class="clear"></div>
<div class="thread-body">
<?php echo $faq->getAnswer(); ?>
<?php echo $faq->getAnswerWithImages(); ?>
</div>
<div class="clear"></div>
<p>
......
......@@ -9,7 +9,7 @@ if($faq){
$info=$faq->getHashtable();
$info['id']=$faq->getId();
$info['topics']=$faq->getHelpTopicsIds();
$info['answer']=$faq->getAnswer();
$info['answer']=Format::viewableImages($faq->getAnswer());
$info['notes']=Format::viewableImages($faq->getNotes());
$qstr='id='.$faq->getId();
}else {
......
......@@ -13,7 +13,8 @@ if($page && $_REQUEST['a']!='add'){
$action='update';
$submit_text='Save Changes';
$info=$page->getHashtable();
$info['body'] = $page->getBodyWithImages();
$info['body'] = Format::viewableImages($page->getBody());
$info['notes'] = Format::viewableImages($info['notes']);
$slug = Format::slugify($info['name']);
$qstr.='&id='.$page->getId();
}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