Browse Source

updated body substring code

2.x
Paul Pound 9 months ago
parent
commit
3c6a627b10
  1. 2
      modules/solr_site/src/Controller/RoblibSearchSolrsiteController.php

2
modules/solr_site/src/Controller/RoblibSearchSolrsiteController.php

@ -97,7 +97,7 @@ class RoblibSearchSolrsiteController extends ControllerBase {
if (!empty($body)) { if (!empty($body)) {
$bodyOutput = strip_tags($body[0]->getText()); $bodyOutput = strip_tags($body[0]->getText());
if (strlen($bodyOutput) > 500) { if (strlen($bodyOutput) > 500) {
$bodyOutput = substr($bodyOutput, 0, 500) . '...'; $bodyOutput = substr($bodyOutput, 0, 499) . '...';
} }
} }
$output['results'][$id]['body'] = empty($bodyOutput) ? '' : $bodyOutput; $output['results'][$id]['body'] = empty($bodyOutput) ? '' : $bodyOutput;

Loading…
Cancel
Save