Browse Source

remove type hint

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

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

@ -33,7 +33,8 @@ 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($input) {
if(!is_string($input)) return [];
preg_match_all('/https?:\/\/[^ ]+/', $input, $matches);
return array_unique($matches[0]);
}
@ -43,7 +44,9 @@ 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($html) {
if(!is_string($input)) return [];
$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