CMoore Posted March 20, 2018 at 12:56 PM Share Posted March 20, 2018 at 12:56 PM One of the issues that we face on or Senioridy.com site is that users will often posts links that open in the parent window within their descriptive text, which places the site visitor onto the linked site instead of ours. Since we already have custom fields that users can utilize in order to post specific links that we allow, we don't really prefer to allow them to post links within the body of the descriptive text. So, in order to remove any links placed within the description we use a bit of regex to remove the links, but keep the text: <?php $descr = $listing['Listing']['text'] !== strip_tags($listing['Listing']['text']) ? $listing['Listing']['text'] : nl2br($listing['Listing']['text']); echo preg_replace('#<a.*?>(.*?)</a>#i', '\1', $descr); ?> I thought I'd share this with the community in case there was a need for it. Link to comment
Alejandro Posted March 20, 2018 at 04:32 PM Share Posted March 20, 2018 at 04:32 PM This section is only visible with a valid subscription. If you have a valid subscription, please login. n00bster 1 Link to comment
Alejandro Posted March 21, 2018 at 07:17 PM Share Posted March 21, 2018 at 07:17 PM This section is only visible with a valid subscription. If you have a valid subscription, please login. Link to comment
JAN44 Posted June 4, 2018 at 10:44 AM Share Posted June 4, 2018 at 10:44 AM This section is only visible with a valid subscription. If you have a valid subscription, please login. Link to comment
CMoore Posted June 4, 2018 at 12:13 PM Author Share Posted June 4, 2018 at 12:13 PM This section is only visible with a valid subscription. If you have a valid subscription, please login. Link to comment
plethoraonline-1492071863 Posted July 3, 2018 at 10:33 PM Share Posted July 3, 2018 at 10:33 PM This section is only visible with a valid subscription. If you have a valid subscription, please login. Link to comment
Recommended Posts