Commit 2f89017c6a69a46936e7637ff32d2f5d55ed2f94
1 parent
7f3a45fc
KTS-2831
"CLONE -End line characters in discussions and disclaimers being displayed as html tags (SUP-546)" Fixed. Removed the calls to sanitiseForSQL before inserting into the database. Committed by: Megan Watson Reviewed by: Conrad Vermeulen git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@7909 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
5 changed files
with
80 additions
and
78 deletions
lib/discussions/DiscussionComment.inc
| @@ -7,38 +7,38 @@ | @@ -7,38 +7,38 @@ | ||
| 7 | * KnowledgeTree Open Source Edition | 7 | * KnowledgeTree Open Source Edition |
| 8 | * Document Management Made Simple | 8 | * Document Management Made Simple |
| 9 | * Copyright (C) 2004 - 2007 The Jam Warehouse Software (Pty) Limited | 9 | * Copyright (C) 2004 - 2007 The Jam Warehouse Software (Pty) Limited |
| 10 | - * | 10 | + * |
| 11 | * This program is free software; you can redistribute it and/or modify it under | 11 | * This program is free software; you can redistribute it and/or modify it under |
| 12 | * the terms of the GNU General Public License version 3 as published by the | 12 | * the terms of the GNU General Public License version 3 as published by the |
| 13 | * Free Software Foundation. | 13 | * Free Software Foundation. |
| 14 | - * | 14 | + * |
| 15 | * This program is distributed in the hope that it will be useful, but WITHOUT | 15 | * This program is distributed in the hope that it will be useful, but WITHOUT |
| 16 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | 16 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
| 17 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | 17 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
| 18 | * details. | 18 | * details. |
| 19 | - * | 19 | + * |
| 20 | * You should have received a copy of the GNU General Public License | 20 | * You should have received a copy of the GNU General Public License |
| 21 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 21 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 22 | - * | 22 | + * |
| 23 | * You can contact The Jam Warehouse Software (Pty) Limited, Unit 1, Tramber Place, | 23 | * You can contact The Jam Warehouse Software (Pty) Limited, Unit 1, Tramber Place, |
| 24 | * Blake Street, Observatory, 7925 South Africa. or email info@knowledgetree.com. | 24 | * Blake Street, Observatory, 7925 South Africa. or email info@knowledgetree.com. |
| 25 | - * | 25 | + * |
| 26 | * The interactive user interfaces in modified source and object code versions | 26 | * The interactive user interfaces in modified source and object code versions |
| 27 | * of this program must display Appropriate Legal Notices, as required under | 27 | * of this program must display Appropriate Legal Notices, as required under |
| 28 | * Section 5 of the GNU General Public License version 3. | 28 | * Section 5 of the GNU General Public License version 3. |
| 29 | - * | 29 | + * |
| 30 | * In accordance with Section 7(b) of the GNU General Public License version 3, | 30 | * In accordance with Section 7(b) of the GNU General Public License version 3, |
| 31 | * these Appropriate Legal Notices must retain the display of the "Powered by | 31 | * these Appropriate Legal Notices must retain the display of the "Powered by |
| 32 | - * KnowledgeTree" logo and retain the original copyright notice. If the display of the | 32 | + * KnowledgeTree" logo and retain the original copyright notice. If the display of the |
| 33 | * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices | 33 | * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices |
| 34 | - * must display the words "Powered by KnowledgeTree" and retain the original | ||
| 35 | - * copyright notice. | 34 | + * must display the words "Powered by KnowledgeTree" and retain the original |
| 35 | + * copyright notice. | ||
| 36 | * Contributor( s): ______________________________________ | 36 | * Contributor( s): ______________________________________ |
| 37 | */ | 37 | */ |
| 38 | 38 | ||
| 39 | class DiscussionComment extends KTEntity { | 39 | class DiscussionComment extends KTEntity { |
| 40 | var $_bUsePearError = true; | 40 | var $_bUsePearError = true; |
| 41 | - | 41 | + |
| 42 | var $iThreadId; | 42 | var $iThreadId; |
| 43 | var $iUserId; | 43 | var $iUserId; |
| 44 | var $sSubject; | 44 | var $sSubject; |
| @@ -66,12 +66,12 @@ class DiscussionComment extends KTEntity { | @@ -66,12 +66,12 @@ class DiscussionComment extends KTEntity { | ||
| 66 | 66 | ||
| 67 | function getThreadId(){ return $this->iThreadId; } | 67 | function getThreadId(){ return $this->iThreadId; } |
| 68 | function setThreadId($iThreadId){ $this->iThreadId = $iThreadId; } | 68 | function setThreadId($iThreadId){ $this->iThreadId = $iThreadId; } |
| 69 | - function getUserId(){ return $this->iUserId; } | 69 | + function getUserId(){ return $this->iUserId; } |
| 70 | function setUserId($iNewUserId){ $this->iUserId = $iNewUserId; } | 70 | function setUserId($iNewUserId){ $this->iUserId = $iNewUserId; } |
| 71 | - function getSubject(){ return sanitizeForSQLtoHTML($this->sSubject); } | ||
| 72 | - function setSubject($sNewSubject){ $this->sSubject = sanitizeForSQL($sNewSubject); } | ||
| 73 | - function getBody(){ return sanitizeForSQLtoHTML($this->sBody); } | ||
| 74 | - function setBody($sNewBody){ $this->sBody = sanitizeForSQL($sNewBody); } | 71 | + function getSubject(){ return $this->sSubject; } |
| 72 | + function setSubject($sNewSubject){ $this->sSubject = $sNewSubject; } | ||
| 73 | + function getBody(){ return $this->sBody; } | ||
| 74 | + function setBody($sNewBody){ $this->sBody = $sNewBody; } | ||
| 75 | function getDate(){ return $this->dDate; } | 75 | function getDate(){ return $this->dDate; } |
| 76 | function getInReplyTo(){ return $this->iInReplyTo; } | 76 | function getInReplyTo(){ return $this->iInReplyTo; } |
| 77 | function setInReplyTo($sNewCommentId){ $this->iInReplyTo = $sNewCommentId; } | 77 | function setInReplyTo($sNewCommentId){ $this->iInReplyTo = $sNewCommentId; } |
plugins/ktstandard/KTDisclaimers.php
| @@ -5,32 +5,32 @@ | @@ -5,32 +5,32 @@ | ||
| 5 | * KnowledgeTree Open Source Edition | 5 | * KnowledgeTree Open Source Edition |
| 6 | * Document Management Made Simple | 6 | * Document Management Made Simple |
| 7 | * Copyright (C) 2004 - 2007 The Jam Warehouse Software (Pty) Limited | 7 | * Copyright (C) 2004 - 2007 The Jam Warehouse Software (Pty) Limited |
| 8 | - * | 8 | + * |
| 9 | * This program is free software; you can redistribute it and/or modify it under | 9 | * This program is free software; you can redistribute it and/or modify it under |
| 10 | * the terms of the GNU General Public License version 3 as published by the | 10 | * the terms of the GNU General Public License version 3 as published by the |
| 11 | * Free Software Foundation. | 11 | * Free Software Foundation. |
| 12 | - * | 12 | + * |
| 13 | * This program is distributed in the hope that it will be useful, but WITHOUT | 13 | * This program is distributed in the hope that it will be useful, but WITHOUT |
| 14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | 14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
| 15 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | 15 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
| 16 | * details. | 16 | * details. |
| 17 | - * | 17 | + * |
| 18 | * You should have received a copy of the GNU General Public License | 18 | * You should have received a copy of the GNU General Public License |
| 19 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 19 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 20 | - * | 20 | + * |
| 21 | * You can contact The Jam Warehouse Software (Pty) Limited, Unit 1, Tramber Place, | 21 | * You can contact The Jam Warehouse Software (Pty) Limited, Unit 1, Tramber Place, |
| 22 | * Blake Street, Observatory, 7925 South Africa. or email info@knowledgetree.com. | 22 | * Blake Street, Observatory, 7925 South Africa. or email info@knowledgetree.com. |
| 23 | - * | 23 | + * |
| 24 | * The interactive user interfaces in modified source and object code versions | 24 | * The interactive user interfaces in modified source and object code versions |
| 25 | * of this program must display Appropriate Legal Notices, as required under | 25 | * of this program must display Appropriate Legal Notices, as required under |
| 26 | * Section 5 of the GNU General Public License version 3. | 26 | * Section 5 of the GNU General Public License version 3. |
| 27 | - * | 27 | + * |
| 28 | * In accordance with Section 7(b) of the GNU General Public License version 3, | 28 | * In accordance with Section 7(b) of the GNU General Public License version 3, |
| 29 | * these Appropriate Legal Notices must retain the display of the "Powered by | 29 | * these Appropriate Legal Notices must retain the display of the "Powered by |
| 30 | - * KnowledgeTree" logo and retain the original copyright notice. If the display of the | 30 | + * KnowledgeTree" logo and retain the original copyright notice. If the display of the |
| 31 | * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices | 31 | * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices |
| 32 | - * must display the words "Powered by KnowledgeTree" and retain the original | ||
| 33 | - * copyright notice. | 32 | + * must display the words "Powered by KnowledgeTree" and retain the original |
| 33 | + * copyright notice. | ||
| 34 | * Contributor( s): ______________________________________ | 34 | * Contributor( s): ______________________________________ |
| 35 | * | 35 | * |
| 36 | */ | 36 | */ |
| @@ -50,7 +50,7 @@ class KTDisclaimersPlugin extends KTPlugin { | @@ -50,7 +50,7 @@ class KTDisclaimersPlugin extends KTPlugin { | ||
| 50 | $res = parent::KTPlugin($sFilename); | 50 | $res = parent::KTPlugin($sFilename); |
| 51 | $this->sFriendlyName = _kt('Disclaimers Plugin'); | 51 | $this->sFriendlyName = _kt('Disclaimers Plugin'); |
| 52 | return $res; | 52 | return $res; |
| 53 | - } | 53 | + } |
| 54 | 54 | ||
| 55 | function setup() { | 55 | function setup() { |
| 56 | $this->setupAdmin(); | 56 | $this->setupAdmin(); |
| @@ -67,25 +67,25 @@ class KTDisclaimersPlugin extends KTPlugin { | @@ -67,25 +67,25 @@ class KTDisclaimersPlugin extends KTPlugin { | ||
| 67 | } | 67 | } |
| 68 | 68 | ||
| 69 | function getDisclaimer($sLocation) { | 69 | function getDisclaimer($sLocation) { |
| 70 | - $sDisclaimer = false; | 70 | + $sDisclaimer = false; |
| 71 | + | ||
| 72 | + if($this->isRegistered()) { | ||
| 73 | + $aHelp = KTHelp::getHelpInfo($sLocation); | ||
| 71 | 74 | ||
| 72 | - if($this->isRegistered()) { | ||
| 73 | - $aHelp = KTHelp::getHelpInfo($sLocation); | ||
| 74 | - | ||
| 75 | - if(!PEAR::isError($aHelp) && strlen(trim($aHelp['body']))) { | ||
| 76 | - $sDisclaimer = $aHelp['body']; | ||
| 77 | - } | ||
| 78 | - } | 75 | + if(!PEAR::isError($aHelp) && strlen(trim($aHelp['body']))) { |
| 76 | + $sDisclaimer = str_replace(array('\r','\n'), array('<br>','<br>'), $aHelp['body']); | ||
| 77 | + } | ||
| 78 | + } | ||
| 79 | 79 | ||
| 80 | - return $sDisclaimer; | 80 | + return $sDisclaimer; |
| 81 | } | 81 | } |
| 82 | 82 | ||
| 83 | function getPageDisclaimer() { | 83 | function getPageDisclaimer() { |
| 84 | - return $this->getDisclaimer($this->aDisclaimers['page']['path']); | 84 | + return $this->getDisclaimer($this->aDisclaimers['page']['path']); |
| 85 | } | 85 | } |
| 86 | 86 | ||
| 87 | function getLoginDisclaimer() { | 87 | function getLoginDisclaimer() { |
| 88 | - return $this->getDisclaimer($this->aDisclaimers['login']['path']); | 88 | + return $this->getDisclaimer($this->aDisclaimers['login']['path']); |
| 89 | } | 89 | } |
| 90 | 90 | ||
| 91 | } | 91 | } |
plugins/ktstandard/KTDiscussion.php
| @@ -5,32 +5,32 @@ | @@ -5,32 +5,32 @@ | ||
| 5 | * KnowledgeTree Open Source Edition | 5 | * KnowledgeTree Open Source Edition |
| 6 | * Document Management Made Simple | 6 | * Document Management Made Simple |
| 7 | * Copyright (C) 2004 - 2007 The Jam Warehouse Software (Pty) Limited | 7 | * Copyright (C) 2004 - 2007 The Jam Warehouse Software (Pty) Limited |
| 8 | - * | 8 | + * |
| 9 | * This program is free software; you can redistribute it and/or modify it under | 9 | * This program is free software; you can redistribute it and/or modify it under |
| 10 | * the terms of the GNU General Public License version 3 as published by the | 10 | * the terms of the GNU General Public License version 3 as published by the |
| 11 | * Free Software Foundation. | 11 | * Free Software Foundation. |
| 12 | - * | 12 | + * |
| 13 | * This program is distributed in the hope that it will be useful, but WITHOUT | 13 | * This program is distributed in the hope that it will be useful, but WITHOUT |
| 14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | 14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
| 15 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | 15 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
| 16 | * details. | 16 | * details. |
| 17 | - * | 17 | + * |
| 18 | * You should have received a copy of the GNU General Public License | 18 | * You should have received a copy of the GNU General Public License |
| 19 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 19 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 20 | - * | 20 | + * |
| 21 | * You can contact The Jam Warehouse Software (Pty) Limited, Unit 1, Tramber Place, | 21 | * You can contact The Jam Warehouse Software (Pty) Limited, Unit 1, Tramber Place, |
| 22 | * Blake Street, Observatory, 7925 South Africa. or email info@knowledgetree.com. | 22 | * Blake Street, Observatory, 7925 South Africa. or email info@knowledgetree.com. |
| 23 | - * | 23 | + * |
| 24 | * The interactive user interfaces in modified source and object code versions | 24 | * The interactive user interfaces in modified source and object code versions |
| 25 | * of this program must display Appropriate Legal Notices, as required under | 25 | * of this program must display Appropriate Legal Notices, as required under |
| 26 | * Section 5 of the GNU General Public License version 3. | 26 | * Section 5 of the GNU General Public License version 3. |
| 27 | - * | 27 | + * |
| 28 | * In accordance with Section 7(b) of the GNU General Public License version 3, | 28 | * In accordance with Section 7(b) of the GNU General Public License version 3, |
| 29 | * these Appropriate Legal Notices must retain the display of the "Powered by | 29 | * these Appropriate Legal Notices must retain the display of the "Powered by |
| 30 | - * KnowledgeTree" logo and retain the original copyright notice. If the display of the | 30 | + * KnowledgeTree" logo and retain the original copyright notice. If the display of the |
| 31 | * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices | 31 | * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices |
| 32 | - * must display the words "Powered by KnowledgeTree" and retain the original | ||
| 33 | - * copyright notice. | 32 | + * must display the words "Powered by KnowledgeTree" and retain the original |
| 33 | + * copyright notice. | ||
| 34 | * Contributor( s): ______________________________________ | 34 | * Contributor( s): ______________________________________ |
| 35 | * | 35 | * |
| 36 | */ | 36 | */ |
| @@ -136,12 +136,12 @@ class KTDocumentDiscussionAction extends KTDocumentAction { | @@ -136,12 +136,12 @@ class KTDocumentDiscussionAction extends KTDocumentAction { | ||
| 136 | $fields[] = new KTStringWidget(_kt("Subject"), _kt("The topic of discussion in this thread"), "subject", "", $this->oPage, true); | 136 | $fields[] = new KTStringWidget(_kt("Subject"), _kt("The topic of discussion in this thread"), "subject", "", $this->oPage, true); |
| 137 | $fields[] = new KTTextWidget(_kt("Body"), _kt("Your contribution to the discussion in this thread"), "body", "", $this->oPage, true, null, null, array("cols" => 50, "rows" => 10)); | 137 | $fields[] = new KTTextWidget(_kt("Body"), _kt("Your contribution to the discussion in this thread"), "body", "", $this->oPage, true, null, null, array("cols" => 50, "rows" => 10)); |
| 138 | 138 | ||
| 139 | - $bIncludeClosed = KTUtil::arrayGet($_REQUEST, 'fIncludeClosed', false); | 139 | + $bIncludeClosed = KTUtil::arrayGet($_REQUEST, 'fIncludeClosed', false); |
| 140 | 140 | ||
| 141 | - $sQuery = sprintf('document_id = %d', $this->oDocument->getId()); | ||
| 142 | - if(!$bIncludeClosed) { | ||
| 143 | - $sQuery .= sprintf(' AND state != %d', DISCUSSION_CLOSED); | ||
| 144 | - } | 141 | + $sQuery = sprintf('document_id = %d', $this->oDocument->getId()); |
| 142 | + if(!$bIncludeClosed) { | ||
| 143 | + $sQuery .= sprintf(' AND state != %d', DISCUSSION_CLOSED); | ||
| 144 | + } | ||
| 145 | 145 | ||
| 146 | $threads = DiscussionThread::getList($sQuery); | 146 | $threads = DiscussionThread::getList($sQuery); |
| 147 | $sQuery2 = sprintf('document_id = %d AND state = %d', $this->oDocument->getId(), DISCUSSION_CLOSED); | 147 | $sQuery2 = sprintf('document_id = %d AND state = %d', $this->oDocument->getId(), DISCUSSION_CLOSED); |
| @@ -183,8 +183,8 @@ class KTDocumentDiscussionAction extends KTDocumentAction { | @@ -183,8 +183,8 @@ class KTDocumentDiscussionAction extends KTDocumentAction { | ||
| 183 | $oComment = DiscussionComment::createFromArray(array( | 183 | $oComment = DiscussionComment::createFromArray(array( |
| 184 | 'threadid' => $oThread->getId(), | 184 | 'threadid' => $oThread->getId(), |
| 185 | 'userid' => $this->oUser->getId(), | 185 | 'userid' => $this->oUser->getId(), |
| 186 | - 'subject' => sanitizeForSQL($sSubject), | ||
| 187 | - 'body' => sanitizeForSQL(KTUtil::formatPlainText($sBody)), | 186 | + 'subject' => $sSubject, |
| 187 | + 'body' => KTUtil::formatPlainText($sBody), | ||
| 188 | )); | 188 | )); |
| 189 | $aErrorOptions['message'] = _kt("There was an error adding the comment to the thread"); | 189 | $aErrorOptions['message'] = _kt("There was an error adding the comment to the thread"); |
| 190 | $this->oValidator->notError($oComment, $aErrorOptions); | 190 | $this->oValidator->notError($oComment, $aErrorOptions); |
| @@ -315,8 +315,8 @@ class KTDocumentDiscussionAction extends KTDocumentAction { | @@ -315,8 +315,8 @@ class KTDocumentDiscussionAction extends KTDocumentAction { | ||
| 315 | $oComment = DiscussionComment::createFromArray(array( | 315 | $oComment = DiscussionComment::createFromArray(array( |
| 316 | 'threadid' => $oThread->getId(), | 316 | 'threadid' => $oThread->getId(), |
| 317 | 'userid' => $this->oUser->getId(), | 317 | 'userid' => $this->oUser->getId(), |
| 318 | - 'subject' => sanitizeForSQL($sSubject), | ||
| 319 | - 'body' => sanitizeForSQL(KTUtil::formatPlainText($sBody)), | 318 | + 'subject' => $sSubject, |
| 319 | + 'body' => KTUtil::formatPlainText($sBody), | ||
| 320 | )); | 320 | )); |
| 321 | $aErrorOptions['message'] = _kt("There was an error adding the comment to the thread"); | 321 | $aErrorOptions['message'] = _kt("There was an error adding the comment to the thread"); |
| 322 | $this->oValidator->notError($oComment, $aErrorOptions); | 322 | $this->oValidator->notError($oComment, $aErrorOptions); |
| @@ -378,7 +378,7 @@ class KTDocumentDiscussionAction extends KTDocumentAction { | @@ -378,7 +378,7 @@ class KTDocumentDiscussionAction extends KTDocumentAction { | ||
| 378 | ); | 378 | ); |
| 379 | 379 | ||
| 380 | $oPermission =& KTPermission::getByName('ktcore.permissions.workflow'); | 380 | $oPermission =& KTPermission::getByName('ktcore.permissions.workflow'); |
| 381 | - $sRedirectTo = implode('&', $aErrorOptions['redirect_to']); | 381 | + $sRedirectTo = implode('&', $aErrorOptions['redirect_to']); |
| 382 | 382 | ||
| 383 | if (PEAR::isError($oPermission)) { | 383 | if (PEAR::isError($oPermission)) { |
| 384 | $this->errorRedirectTo($sRedirectTo, _kt("Error getting permission")); | 384 | $this->errorRedirectTo($sRedirectTo, _kt("Error getting permission")); |
| @@ -389,30 +389,30 @@ class KTDocumentDiscussionAction extends KTDocumentAction { | @@ -389,30 +389,30 @@ class KTDocumentDiscussionAction extends KTDocumentAction { | ||
| 389 | exit(0); | 389 | exit(0); |
| 390 | } | 390 | } |
| 391 | 391 | ||
| 392 | - $iStateId = KTUtil::arrayGet($_REQUEST, 'state'); | ||
| 393 | - if(!in_array($iStateId, $this->aTransitions[$oThread->getState()])) { | ||
| 394 | - $this->errorRedirectTo($sRedirectTo, _kt("Invalid transition")); | ||
| 395 | - exit(0); | ||
| 396 | - } | 392 | + $iStateId = KTUtil::arrayGet($_REQUEST, 'state'); |
| 393 | + if(!in_array($iStateId, $this->aTransitions[$oThread->getState()])) { | ||
| 394 | + $this->errorRedirectTo($sRedirectTo, _kt("Invalid transition")); | ||
| 395 | + exit(0); | ||
| 396 | + } | ||
| 397 | 397 | ||
| 398 | - $aErrorOptions['message'] = _kt("No reason provided"); | ||
| 399 | - $sReason = sanitizeForSQL($this->oValidator->validateString(KTUtil::arrayGet($_REQUEST, 'reason'), $aErrorOptions)); | 398 | + $aErrorOptions['message'] = _kt("No reason provided"); |
| 399 | + $sReason = $this->oValidator->validateString(KTUtil::arrayGet($_REQUEST, 'reason'), $aErrorOptions); | ||
| 400 | 400 | ||
| 401 | - if($iStateId > $oThread->getState()) { | ||
| 402 | - $sTransactionNamespace = 'ktcore.transactions.collaboration_step_approve'; | ||
| 403 | - } else { | ||
| 404 | - $sTransactionNamespace = 'ktcore.transactions.collaboration_step_rollback'; | ||
| 405 | - } | 401 | + if($iStateId > $oThread->getState()) { |
| 402 | + $sTransactionNamespace = 'ktcore.transactions.collaboration_step_approve'; | ||
| 403 | + } else { | ||
| 404 | + $sTransactionNamespace = 'ktcore.transactions.collaboration_step_rollback'; | ||
| 405 | + } | ||
| 406 | 406 | ||
| 407 | // Start the transaction comment creation | 407 | // Start the transaction comment creation |
| 408 | $this->startTransaction(); | 408 | $this->startTransaction(); |
| 409 | 409 | ||
| 410 | $oThread->setState($iStateId); | 410 | $oThread->setState($iStateId); |
| 411 | - if($iStateId == DISCUSSION_CLOSED) { | ||
| 412 | - $oThread->setCloseMetadataVersion($this->oDocument->getMetadataVersion()); | ||
| 413 | - } else if($iStateId == DISCUSSION_CONCLUSION) { | ||
| 414 | - $oThread->setCloseReason($sReason); | ||
| 415 | - } | 411 | + if($iStateId == DISCUSSION_CLOSED) { |
| 412 | + $oThread->setCloseMetadataVersion($this->oDocument->getMetadataVersion()); | ||
| 413 | + } else if($iStateId == DISCUSSION_CONCLUSION) { | ||
| 414 | + $oThread->setCloseReason($sReason); | ||
| 415 | + } | ||
| 416 | 416 | ||
| 417 | $oDocumentTransaction = new DocumentTransaction($this->oDocument, $sReason, $sTransactionNamespace); | 417 | $oDocumentTransaction = new DocumentTransaction($this->oDocument, $sReason, $sTransactionNamespace); |
| 418 | $oDocumentTransaction->create(); | 418 | $oDocumentTransaction->create(); |
| @@ -429,9 +429,6 @@ class KTDocumentDiscussionAction extends KTDocumentAction { | @@ -429,9 +429,6 @@ class KTDocumentDiscussionAction extends KTDocumentAction { | ||
| 429 | exit(0); | 429 | exit(0); |
| 430 | } | 430 | } |
| 431 | 431 | ||
| 432 | - | ||
| 433 | - | ||
| 434 | - | ||
| 435 | function &_buildStates(&$oThread) { | 432 | function &_buildStates(&$oThread) { |
| 436 | $iCurState = $oThread->getState(); | 433 | $iCurState = $oThread->getState(); |
| 437 | $aTransitions = $this->aTransitions[$iCurState]; | 434 | $aTransitions = $this->aTransitions[$iCurState]; |
| @@ -450,3 +447,4 @@ class KTDocumentDiscussionAction extends KTDocumentAction { | @@ -450,3 +447,4 @@ class KTDocumentDiscussionAction extends KTDocumentAction { | ||
| 450 | 447 | ||
| 451 | 448 | ||
| 452 | } | 449 | } |
| 450 | +?> | ||
| 453 | \ No newline at end of file | 451 | \ No newline at end of file |
sql/mysql/upgrade/3.4.6/remove_backslashes.sql
| @@ -12,4 +12,8 @@ SET name = replace(replace(replace(name, '\\\\', '\\'), '\\\"', '\"'), '\\\'', ' | @@ -12,4 +12,8 @@ SET name = replace(replace(replace(name, '\\\\', '\\'), '\\\"', '\"'), '\\\'', ' | ||
| 12 | 12 | ||
| 13 | UPDATE folders | 13 | UPDATE folders |
| 14 | SET name = replace(replace(replace(name, '\\\\', '\\'), '\\\"', '\"'), '\\\'', '\''), | 14 | SET name = replace(replace(replace(name, '\\\\', '\\'), '\\\"', '\"'), '\\\'', '\''), |
| 15 | - description = replace(replace(replace(description, '\\\\', '\\'), '\\\"', '\"'), '\\\'', '\''); | ||
| 16 | \ No newline at end of file | 15 | \ No newline at end of file |
| 16 | + description = replace(replace(replace(description, '\\\\', '\\'), '\\\"', '\"'), '\\\'', '\''); | ||
| 17 | + | ||
| 18 | +UPDATE discussion_comments | ||
| 19 | +SET subject = replace(replace(replace(subject, '\\\\', '\\'), '\\\"', '\"'), '\\\'', '\''), | ||
| 20 | + body = replace(replace(replace(body, '\\\\', '\\'), '\\\"', '\"'), '\\\'', '\''); | ||
| 17 | \ No newline at end of file | 21 | \ No newline at end of file |
templates/ktstandard/action/discussion_comment_list_item.smarty
| @@ -7,14 +7,14 @@ | @@ -7,14 +7,14 @@ | ||
| 7 | {/if} | 7 | {/if} |
| 8 | 8 | ||
| 9 | <dt> | 9 | <dt> |
| 10 | - <span class="subject">{$comment->getSubject()|sanitize_input}</span> | 10 | + <span class="subject">{$comment->getSubject()}</span> |
| 11 | by | 11 | by |
| 12 | <span class="author">{$creator->getName()}</span> | 12 | <span class="author">{$creator->getName()}</span> |
| 13 | <span class="date">({$comment->getDate()})</span> | 13 | <span class="date">({$comment->getDate()})</span> |
| 14 | 14 | ||
| 15 | </dt> | 15 | </dt> |
| 16 | 16 | ||
| 17 | - <dd>{$comment->getBody()|sanitize_input}</dd> | 17 | + <dd>{$comment->getBody()}</dd> |
| 18 | 18 | ||
| 19 | </dl> | 19 | </dl> |
| 20 | 20 |