diff --git a/lib/Telegraph/FindLinks.php b/lib/Telegraph/FindLinks.php
index 722835b..5ddf8eb 100644
--- a/lib/Telegraph/FindLinks.php
+++ b/lib/Telegraph/FindLinks.php
@@ -45,7 +45,7 @@ class FindLinks {
* @return mixed array of links in text block.
*/
public static function inHTML($html) {
- if(!is_string($input)) return [];
+ if(!is_string($html)) return [];
$doc = new DOMDocument();
libxml_use_internal_errors(true); # suppress parse errors and warnings
diff --git a/tests/FindLinksTest.php b/tests/FindLinksTest.php
index 6358b8a..9fb59e2 100644
--- a/tests/FindLinksTest.php
+++ b/tests/FindLinksTest.php
@@ -38,5 +38,19 @@ class FindLinksTest extends PHPUnit_Framework_TestCase {
$this->assertContains('http://example.html/', $links);
}
+ public function testFindLinksInXRayResult() {
+ $data = json_decode('
+{"data":{"type":"entry","published":"2018-06-19T14:32:44-07:00","url":"https://aaronparecki.com/2018/06/19/12/indiewebsummit","category":["indieweb"],"syndication":["https://twitter.com/aaronpk/status/1009187255204732928"],"content":{"text":"I\'m excited to announce that @namedotcom is our newest sponsor of @IndieWebSummit and they\'ll be joining us next week! It\'s not too late to register! \ud83d\udd1c https://2018.indieweb.org","html":"I\'m excited to announce that @namedotcom is our newest sponsor of @IndieWebSummit and they\'ll be joining us next week! It\'s not too late to register! \ud83d\udd1c https://2018.indieweb.org"},"author":{"type":"card","name":"Aaron Parecki","url":"https://aaronparecki.com/","photo":"https://aaronparecki.com/images/profile.jpg"}},"url":"https://aaronparecki.com/2018/06/19/12/indiewebsummit","code":200}
+', true);
+ unset($data['data']['author']);
+ $links = FindLinks::all($data['data']);
+ $this->assertContains('https://aaronparecki.com/2018/06/19/12/indiewebsummit', $links);
+ $this->assertContains('https://twitter.com/aaronpk/status/1009187255204732928', $links);
+ $this->assertContains('https://2018.indieweb.org', $links);
+ $this->assertContains('https://twitter.com/namedotcom', $links);
+ $this->assertContains('https://twitter.com/IndieWebSummit', $links);
+ $this->assertContains('https://aaronparecki.com/emoji/%F0%9F%94%9C', $links);
+ }
+
}