接口调整
This commit is contained in:
@@ -188,6 +188,7 @@ class References extends Base
|
|||||||
if(!is_string($sContent)){
|
if(!is_string($sContent)){
|
||||||
return json_encode(['status' => 2,'msg' => 'The content format is incorrect']);
|
return json_encode(['status' => 2,'msg' => 'The content format is incorrect']);
|
||||||
}
|
}
|
||||||
|
$sContent = str_replace(['?','?'], '.', $sContent);
|
||||||
$aContent = explode('.', $sContent);
|
$aContent = explode('.', $sContent);
|
||||||
$aUpdate = [];
|
$aUpdate = [];
|
||||||
if(count($aContent) > 1){
|
if(count($aContent) > 1){
|
||||||
@@ -218,6 +219,7 @@ class References extends Base
|
|||||||
$doiPattern = '/10\.\d{4,9}\/[^\s\/?#&=]+/i';
|
$doiPattern = '/10\.\d{4,9}\/[^\s\/?#&=]+/i';
|
||||||
if (preg_match($doiPattern, $sDoi, $matches)) {
|
if (preg_match($doiPattern, $sDoi, $matches)) {
|
||||||
$aUpdate['doi'] = $matches[0];
|
$aUpdate['doi'] = $matches[0];
|
||||||
|
$aUpdate['doilink'] = 'https://doi.org/'.''.$aUpdate['doi'];
|
||||||
}else{
|
}else{
|
||||||
$aUpdate['doi'] = $sDoi;
|
$aUpdate['doi'] = $sDoi;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user