| @@ -116,8 +116,13 @@ function random_record (){ | |||
| $output['title'] = $title[1]; | |||
| // Search for the abstract in the content element and display it | |||
| preg_match('/Abstract.*\n(.*)\n/', $content, $abstract); | |||
| $output['abstract'] = $abstract[1]; | |||
| if (preg_match('/Abstract.*\n(.*)\n/', $content, $abstract)){ | |||
| $output['abstract'] = $abstract[1]; | |||
| } | |||
| else { | |||
| preg_match('/\(.\) \\n\\n(.*)\\n/', $content, $abstract); | |||
| $output['abstract'] = $abstract[1]; | |||
| } | |||
| return $output; | |||