| @@ 247-257 (lines=11) @@ | ||
| 244 | ||
| 245 | // Link to a file on this site. |
|
| 246 | $matches = array(); |
|
| 247 | if(preg_match('/\[file_link(?:\s*|%20|,)?id=([0-9]+)\]/i', $href, $matches)) { |
|
| 248 | $results[] = array( |
|
| 249 | 'Type' => 'file', |
|
| 250 | 'Target' => $matches[1], |
|
| 251 | 'Anchor' => null, |
|
| 252 | 'DOMReference' => $link, |
|
| 253 | 'Broken' => !DataObject::get_by_id('File', $matches[1]) |
|
| 254 | ); |
|
| 255 | ||
| 256 | continue; |
|
| 257 | } |
|
| 258 | ||
| 259 | // Local anchor. |
|
| 260 | $matches = array(); |
|
| @@ 261-271 (lines=11) @@ | ||
| 258 | ||
| 259 | // Local anchor. |
|
| 260 | $matches = array(); |
|
| 261 | if(preg_match('/^#(.*)/i', $href, $matches)) { |
|
| 262 | $results[] = array( |
|
| 263 | 'Type' => 'localanchor', |
|
| 264 | 'Target' => null, |
|
| 265 | 'Anchor' => $matches[1], |
|
| 266 | 'DOMReference' => $link, |
|
| 267 | 'Broken' => !preg_match("#(name|id)=\"{$matches[1]}\"#", $htmlValue->getContent()) |
|
| 268 | ); |
|
| 269 | ||
| 270 | continue; |
|
| 271 | } |
|
| 272 | ||
| 273 | } |
|
| 274 | ||