Explorar el Código

fixing some errors

main
Simon Bowie hace 2 años
padre
commit
38823c439d
Se han modificado 1 ficheros con 4 adiciones y 2 borrados
  1. +4
    -2
      site/ops_api.php

+ 4
- 2
site/ops_api.php Ver fichero

@@ -56,13 +56,15 @@ function get_publication_details($document_reference) {

if (strpos($response,"No results found") === false ) {

global $output;

// Turn the API response into useful Json
$json = json_decode($response);

// For each invention title, check if it's in the original language
foreach ($json->{'ops:world-patent-data'}->{'exchange-documents'}->{'exchange-document'}->{'bibliographic-data'}->{'invention-title'} as $invention_title){

if ($invention_title->{'@lang'} === 'ol'){
if ((isset($invention_title->{'@lang'})) && ($invention_title->{'@lang'} === 'ol')){

$output['original_title'] = $invention_title->{'$'};

@@ -73,7 +75,7 @@ function get_publication_details($document_reference) {
// For each abstract, check if it's in the original language
foreach ($json->{'ops:world-patent-data'}->{'exchange-documents'}->{'exchange-document'}->{'abstract'} as $abstract){

if ($abstract->{'@lang'} === 'ol'){
if ((isset($abstract->{'@lang'})) && ($abstract->{'@lang'} === 'ol')){

$output['original_abstract'] = $abstract->p->{'$'};


Cargando…
Cancelar
Guardar