| @@ 269-279 (lines=11) @@ | ||
| 266 | ||
| 267 | // Link to a file on this site. |
|
| 268 | $matches = array(); |
|
| 269 | if(preg_match('/\[file_link(?:\s*|%20|,)?id=([0-9]+)\]/i', $href, $matches)) { |
|
| 270 | $results[] = array( |
|
| 271 | 'Type' => 'file', |
|
| 272 | 'Target' => $matches[1], |
|
| 273 | 'Anchor' => null, |
|
| 274 | 'DOMReference' => $link, |
|
| 275 | 'Broken' => !DataObject::get_by_id('File', $matches[1]) |
|
| 276 | ); |
|
| 277 | ||
| 278 | continue; |
|
| 279 | } |
|
| 280 | ||
| 281 | // Local anchor. |
|
| 282 | $matches = array(); |
|
| @@ 283-293 (lines=11) @@ | ||
| 280 | ||
| 281 | // Local anchor. |
|
| 282 | $matches = array(); |
|
| 283 | if(preg_match('/^#(.*)/i', $href, $matches)) { |
|
| 284 | $results[] = array( |
|
| 285 | 'Type' => 'localanchor', |
|
| 286 | 'Target' => null, |
|
| 287 | 'Anchor' => $matches[1], |
|
| 288 | 'DOMReference' => $link, |
|
| 289 | 'Broken' => !preg_match("#(name|id)=\"{$matches[1]}\"#", $htmlValue->getContent()) |
|
| 290 | ); |
|
| 291 | ||
| 292 | continue; |
|
| 293 | } |
|
| 294 | ||
| 295 | } |
|
| 296 | ||