Stephen Ficklin преди 11 години
родител
ревизия
36bd0104f8
променени са 1 файла, в които са добавени 14 реда и са изтрити 0 реда
  1. 14 0
      tripal_pub/includes/importers/AGL.inc

+ 14 - 0
tripal_pub/includes/importers/AGL.inc

@@ -813,6 +813,20 @@ function tripal_pub_AGL_parse_pubxml($pub_xml) {
     $pub['Authors'] = $pub['Author List'];	
   }
 
+  // for Title, Abstract, Authors, convert the html entity and remove special unicode chars that are not meant for display
+  $pub['Title'] = preg_replace( '/[\p{So}]/u', '', mb_convert_encoding($pub['Title'], 'UTF-8', 'HTML-ENTITIES'));
+  if (key_exists('Abstract', $pub)) {
+    $pub['Abstract'] =preg_replace( '/[\p{So}]/u', '',mb_convert_encoding($pub['Abstract'], 'UTF-8', 'HTML-ENTITIES'));
+  }
+  $newauths = array();
+  foreach ($pub['Author List'] AS $auth) {
+    foreach($auth AS $k => $v) {
+      $auth[$k] = preg_replace( '/[\p{So}]/u', '',mb_convert_encoding($v, 'UTF-8', 'HTML-ENTITIES'));
+    }
+    array_push($newauths, $auth);
+  }
+  $pub['Author List'] = $newauths;
+
   // build the citation
   $pub['Citation'] = tripal_pub_create_citation($pub);