You are here

protected function ForwardForm::cleanString in Forward 4.0.x

Same name and namespace in other branches
  1. 8.3 src/Form/ForwardForm.php \Drupal\forward\Form\ForwardForm::cleanString()
  2. 8 src/Form/ForwardForm.php \Drupal\forward\Form\ForwardForm::cleanString()
  3. 8.2 src/Form/ForwardForm.php \Drupal\forward\Form\ForwardForm::cleanString()
  4. 4.x src/Form/ForwardForm.php \Drupal\forward\Form\ForwardForm::cleanString()

Clean a string.

1 call to ForwardForm::cleanString()
ForwardForm::getToken in src/Form/ForwardForm.php
Get a token.

File

src/Form/ForwardForm.php, line 638

Class

ForwardForm
Forward a page to a friend.

Namespace

Drupal\forward\Form

Code

protected function cleanString($string) {

  // Strip embedded URLs.
  $string = preg_replace('|https?://www\\.[a-z\\.0-9]+|i', '', $string);
  $string = preg_replace('|www\\.[a-z\\.0-9]+|i', '', $string);
  return $string;
}