Page 1 of 1

HowTo strip links from generated documents

Posted: Thu Jul 29, 2010 10:19 am
by havlatm
Edit lib/results/printDocument.php. Find the request: "echo $generatedText;" and add the code below above. Set configuration parameter as described.

Code: Select all

// Strip links from a generated document (except the document internals; i.e. content links)
// Add into custom_config.inc.php: $tlCfg->document_generator->stripLinks = ENABLED;
// @author havlatm (20100729)
if (isset($tlCfg->document_generator->stripLinks) && $tlCfg->document_generator->stripLinks)
{
    $generatedText = preg_replace('/<a href="http:[\/\w.]*">|<\/a>/i', '', $generatedText);
}

// send out the data
echo $generatedText;