From 4e130ee0e377b297b533a567aefe2b142e02e6bd Mon Sep 17 00:00:00 2001 From: rsteffen Date: Tue, 4 Aug 2020 10:23:13 +0200 Subject: [PATCH] fix cutting of multibyte strings in abstract --- DNBExportPlugin.inc.php | 3 --- filter/DNBXmlFilter.inc.php | 2 +- version.xml | 4 ++-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/DNBExportPlugin.inc.php b/DNBExportPlugin.inc.php index 0a6c255..78a9209 100644 --- a/DNBExportPlugin.inc.php +++ b/DNBExportPlugin.inc.php @@ -189,9 +189,6 @@ function depositXML($object, $context, $filename) { $curlError = curl_error($curlCh); - error_log("RS_DEBUG:DNB_PLUGIN:deposit: ".print_r($response,true)); - error_log("RS_DEBUG:DNB_PLUGIN:deposit: ".print_r($curlError,true)); - if ($curlError) { // error occured $param = __('plugins.importexport.dnb.deposit.error.fileUploadFailed.param', array('package' => basename($filename), 'articleId' => $object->getSubmissionId(), 'error' => $curlError)); diff --git a/filter/DNBXmlFilter.inc.php b/filter/DNBXmlFilter.inc.php index 8bc5dc2..e550830 100644 --- a/filter/DNBXmlFilter.inc.php +++ b/filter/DNBXmlFilter.inc.php @@ -214,7 +214,7 @@ function &process(&$pubObject) { //remove line breaks in case DNB doesn't like them (they are allowed in XML 1.0 spec) $abstract = preg_replace("#[\s\n\r]+#",' ',$abstract); if (strlen($abstract) > 999) { - $abstract = substr($abstract, 0, 996); + $abstract = mb_substr($abstract, 0, 996,"UTF-8"); $abstract .= '...'; } $abstractURL = $request->url(null, 'article', 'view', array($article->getId())); diff --git a/version.xml b/version.xml index f88b3aa..c90ab71 100644 --- a/version.xml +++ b/version.xml @@ -14,6 +14,6 @@ dnb plugins.importexport - 1.3.0.0 - 2020-24-04 + 1.3.1.0 + 2020-04-08