예제 #1
0
 /**
  * Runs tests for Test::autoLinkEmails
  *
  * @test
  * @dataProvider provider_auto_link_emails
  */
 public function test_auto_link_emails($expected, $text)
 {
     // Use html_entity_decode because emails will be randomly encoded by HTML::mailto
     $this->assertSame($expected, html_entity_decode(Text::autoLinkEmails($text)));
 }
예제 #2
0
파일: Text.php 프로젝트: braf/phalcana-core
 /**
  * Converts text email addresses and anchors into links. Existing links
  * will not be altered.
  *
  *     echo Text::autoLink($text);
  *
  * [!!] This method is not foolproof since it uses regex to parse HTML.
  *
  * @param   string  $text   text to auto link
  * @return  string
  * @uses    Text::autoLinkUrls
  * @uses    Text::autoLinkEmails
  */
 public static function autoLink($text)
 {
     // Auto link emails first to prevent problems with "*****@*****.**"
     return Text::autoLinkUrls(Text::autoLinkEmails($text));
 }