Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / remarkup / engineextension / PhabricatorRemarkupHyperlinkEngineExtension.php
blobd3c7a3f62463ddde1fb50cbb0459803f9514d4e0
1 <?php
3 abstract class PhabricatorRemarkupHyperlinkEngineExtension
4 extends PhutilRemarkupHyperlinkEngineExtension {
6 final protected function getSelfLinks(array $hyperlinks) {
7 assert_instances_of($hyperlinks, 'PhutilRemarkupHyperlinkRef');
9 $allowed_protocols = array(
10 'http' => true,
11 'https' => true,
14 $results = array();
15 foreach ($hyperlinks as $link) {
16 $uri = $link->getURI();
18 if (!PhabricatorEnv::isSelfURI($uri)) {
19 continue;
22 $protocol = id(new PhutilURI($uri))->getProtocol();
23 if (!isset($allowed_protocols[$protocol])) {
24 continue;
27 $results[] = $link;
30 return $results;