@@ -28,37 +28,37 @@ discard block |
||
| 28 | 28 | $tags = $dom->getElementsByTagName('a'); |
| 29 | 29 | $links = array(); |
| 30 | 30 | |
| 31 | - if($tags->length) |
|
| 31 | + if ($tags->length) |
|
| 32 | 32 | { |
| 33 | - foreach($tags as $item) |
|
| 33 | + foreach ($tags as $item) |
|
| 34 | 34 | { |
| 35 | 35 | $link = $item->getAttribute('href'); |
| 36 | 36 | |
| 37 | - if($link != '' && strpos($link,'#') !== 0 && strpos(strtolower($link),'javascript:') !== 0) |
|
| 37 | + if ($link != '' && strpos($link, '#') !== 0 && strpos(strtolower($link), 'javascript:') !== 0) |
|
| 38 | 38 | { |
| 39 | 39 | $link = parse_url($link); |
| 40 | 40 | |
| 41 | - if(!isset($link['scheme'])) |
|
| 41 | + if (!isset($link['scheme'])) |
|
| 42 | 42 | { |
| 43 | 43 | $link['scheme'] = $this->data['parsed_url']['scheme']; |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | - if(!isset($link['host'])) |
|
| 46 | + if (!isset($link['host'])) |
|
| 47 | 47 | { |
| 48 | 48 | $link['host'] = $this->data['parsed_url']['host']; |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | - if(!isset($link['path'])) |
|
| 51 | + if (!isset($link['path'])) |
|
| 52 | 52 | { |
| 53 | 53 | $link['path'] = ''; |
| 54 | 54 | } else { |
| 55 | - if(strpos($link['path'],'/') !== 0) |
|
| 55 | + if (strpos($link['path'], '/') !== 0) |
|
| 56 | 56 | { |
| 57 | 57 | $link['path'] = '/'.$link['path']; |
| 58 | 58 | } |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | - if(!isset($link['query'])) |
|
| 61 | + if (!isset($link['query'])) |
|
| 62 | 62 | { |
| 63 | 63 | $link['query'] = ''; |
| 64 | 64 | } else { |
@@ -86,9 +86,9 @@ discard block |
||
| 86 | 86 | $tags = $dom->getElementsByTagName($tag); |
| 87 | 87 | $links = array(); |
| 88 | 88 | |
| 89 | - if($tags->length) |
|
| 89 | + if ($tags->length) |
|
| 90 | 90 | { |
| 91 | - foreach($tags as $item) |
|
| 91 | + foreach ($tags as $item) |
|
| 92 | 92 | { |
| 93 | 93 | $links[] = $item->getAttribute($attr); |
| 94 | 94 | } |