HowTo strip links from generated documents

1.8 related questions and discussions.
Please upgrade to LATEST 1.9.x.
No more fixes for 1.8.

Moderators: Amaradana, TurboPT, TL Developers

Locked
havlatm
Member of TestLink Community
Posts: 940
Joined: Mon Oct 31, 2005 1:24 am
Location: Czech

HowTo strip links from generated documents

Post 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;
Locked