From edc0199cc6c0c6590af39a38dbccf7070a97365f Mon Sep 17 00:00:00 2001 From: Alec Smecher Date: Mon, 19 Jul 2010 10:17:46 -0700 Subject: [PATCH] *5568* Added String::html2text method --- .../sectionEditor/SectionEditorAction.inc.php | 20 +++++++------------ lib/pkp | 2 +- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/classes/submission/sectionEditor/SectionEditorAction.inc.php b/classes/submission/sectionEditor/SectionEditorAction.inc.php index cd43196bdbb..aeba2871e3a 100644 --- a/classes/submission/sectionEditor/SectionEditorAction.inc.php +++ b/classes/submission/sectionEditor/SectionEditorAction.inc.php @@ -250,7 +250,7 @@ function notifyReviewer($sectionEditorSubmission, $reviewId, $send = false) { 'reviewerUsername' => $reviewer->getUsername(), 'reviewerPassword' => $reviewer->getPassword(), 'editorialContactSignature' => $user->getContactSignature(), - 'reviewGuidelines' => String::html2utf(strip_tags($journal->getLocalizedSetting('reviewGuidelines'))), + 'reviewGuidelines' => String::html2text($journal->getLocalizedSetting('reviewGuidelines')), 'submissionReviewUrl' => $submissionUrl, 'abstractTermIfEnabled' => ($sectionEditorSubmission->getLocalizedAbstract() == ''?'':Locale::translate('article.abstract')), 'passwordResetUrl' => Request::url(null, 'login', 'resetPassword', $reviewer->getUsername(), array('confirm' => Validation::generatePasswordResetHash($reviewer->getId()))) @@ -1972,13 +1972,7 @@ function emailEditorDecisionComment($sectionEditorSubmission, $send) { if (is_array($articleComments)) { foreach ($articleComments as $comment) { // If the comment is viewable by the author, then add the comment. - if ($comment->getViewable()) { - $body .= String::html2utf( - strip_tags( - str_replace(array('

', '
', '
'), array("\n", "\n", "\n"), $comment->getComments()) - ) - ) . "\n\n"; - } + if ($comment->getViewable()) $body .= String::html2text($comment->getComments()) . "\n\n"; } } $body .= "------------------------------------------------------\n\n"; @@ -1993,7 +1987,7 @@ function emailEditorDecisionComment($sectionEditorSubmission, $send) { $body .= Locale::translate('submission.comments.importPeerReviews.reviewerLetter', array('reviewerLetter' => chr(ord('A') + $reviewIndexes[$reviewAssignment->getId()]))) . "\n\n"; } foreach ($reviewFormElements as $reviewFormElement) if ($reviewFormElement->getIncluded()) { - $body .= strip_tags(String::html2utf($reviewFormElement->getLocalizedQuestion())) . ": \n"; + $body .= String::html2text($reviewFormElement->getLocalizedQuestion()) . ": \n"; $reviewFormResponse = $reviewFormResponseDao->getReviewFormResponse($reviewId, $reviewFormElement->getId()); if ($reviewFormResponse) { @@ -2001,14 +1995,14 @@ function emailEditorDecisionComment($sectionEditorSubmission, $send) { if (in_array($reviewFormElement->getElementType(), $reviewFormElement->getMultipleResponsesElementTypes())) { if ($reviewFormElement->getElementType() == REVIEW_FORM_ELEMENT_TYPE_CHECKBOXES) { foreach ($reviewFormResponse->getValue() as $value) { - $body .= "\t" . String::html2utf(strip_tags($possibleResponses[$value-1]['content'])) . "\n"; + $body .= "\t" . String::html2text($possibleResponses[$value-1]['content']) . "\n"; } } else { - $body .= "\t" . String::html2utf(strip_tags($possibleResponses[$reviewFormResponse->getValue()-1]['content'])) . "\n"; + $body .= "\t" . String::html2text($possibleResponses[$reviewFormResponse->getValue()-1]['content']) . "\n"; } $body .= "\n"; } else { - $body .= "\t" . String::html2utf(strip_tags($reviewFormResponse->getValue())) . "\n\n"; + $body .= "\t" . String::html2text($reviewFormResponse->getValue()) . "\n\n"; } } } @@ -2045,7 +2039,7 @@ function blindCcReviewsToReviewers($article, $send = false, $inhibitExistingEmai $commentsText = ""; foreach ($comments as $comment) { - $commentsText .= String::html2utf(strip_tags($comment->getComments())) . "\n\n"; + $commentsText .= String::html2text($comment->getComments()) . "\n\n"; } $user =& Request::getUser(); diff --git a/lib/pkp b/lib/pkp index 4cead07aa76..1ea73bda288 160000 --- a/lib/pkp +++ b/lib/pkp @@ -1 +1 @@ -Subproject commit 4cead07aa76db7515423df2ce7d26c869058eed0 +Subproject commit 1ea73bda2882b6fa3e5fb6a66f5eb40e3593c59b