Aaron Parecki 5 years ago
parent
commit
091777dadd
No known key found for this signature in database GPG Key ID: 276C2817346D6056
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      lib/Telegraph/FindLinks.php

+ 2
- 2
lib/Telegraph/FindLinks.php View File

@ -33,7 +33,7 @@ class FindLinks {
* @param $input string text block
* @return mixed array of links in text block.
*/
public static function inText(string $input) {
public static function inText(\string $input) {
preg_match_all('/https?:\/\/[^ ]+/', $input, $matches);
return array_unique($matches[0]);
}
@ -43,7 +43,7 @@ class FindLinks {
* @param $input string text block
* @return mixed array of links in text block.
*/
public static function inHTML(string $html) {
public static function inHTML(\string $html) {
$doc = new DOMDocument();
libxml_use_internal_errors(true); # suppress parse errors and warnings
@$doc->loadHTML(self::toHtmlEntities($html), LIBXML_NOWARNING|LIBXML_NOERROR);

Loading…
Cancel
Save