[HaveIBeenPwnedBridge] Display breach type (#1203)
* Extract breach types for each data breach * Add paragraph tag
This commit is contained in:
parent
a31e518a07
commit
7e6c58b67a
1 changed files with 22 additions and 2 deletions
|
@ -58,8 +58,9 @@ class HaveIBeenPwnedBridge extends BridgeAbstract {
|
|||
$item['breachDate'] = strtotime($breachDate[1]);
|
||||
$item['uri'] = self::URI . '/PwnedWebsites' . $permalink;
|
||||
|
||||
$item['content'] = '<p>' . $breach->find('p', 0)->innertext . '<p>';
|
||||
$item['content'] .= '<p>' . $breach->find('p', 1)->innertext . '<p>';
|
||||
$item['content'] = '<p>' . $breach->find('p', 0)->innertext . '</p>';
|
||||
$item['content'] .= '<p>' . $this->breachType($breach) . '</p>';
|
||||
$item['content'] .= '<p>' . $breach->find('p', 1)->innertext . '</p>';
|
||||
|
||||
$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 . '.<br>';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $content;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Order Breaches by date added or date breached
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue