diff --git a/bridges/HaveIBeenPwnedBridge.php b/bridges/HaveIBeenPwnedBridge.php index caf73f31..1eb62e32 100644 --- a/bridges/HaveIBeenPwnedBridge.php +++ b/bridges/HaveIBeenPwnedBridge.php @@ -58,8 +58,9 @@ class HaveIBeenPwnedBridge extends BridgeAbstract { $item['breachDate'] = strtotime($breachDate[1]); $item['uri'] = self::URI . '/PwnedWebsites' . $permalink; - $item['content'] = '

' . $breach->find('p', 0)->innertext . '

'; - $item['content'] .= '

' . $breach->find('p', 1)->innertext . '

'; + $item['content'] = '

' . $breach->find('p', 0)->innertext . '

'; + $item['content'] .= '

' . $this->breachType($breach) . '

'; + $item['content'] .= '

' . $breach->find('p', 1)->innertext . '

'; $this->breaches[] = $item; } @@ -68,6 +69,25 @@ class HaveIBeenPwnedBridge extends BridgeAbstract { $this->createItems(); } + /** + * Extract data breach type(s) + */ + private function breachType($breach) { + + $content = ''; + + if ($breach->find('h3 > i', 0)) { + + foreach ($breach->find('h3 > i') as $i) { + $content .= $i->title . '.
'; + } + + } + + return $content; + + } + /** * Order Breaches by date added or date breached */