12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <?php
- abstract class WebFingerResource
- {
- protected $identities = array();
- protected $object = null;
- protected $type = null;
- public function __construct(Managed_DataObject $object)
- {
- $this->object = $object;
- }
- public function getObject()
- {
- if ($this->object === null) {
- throw new ServerException('Object is not set');
- }
- return $this->object;
- }
- public function getAliases()
- {
- $aliases = $this->object->getAliasesWithIDs();
-
-
-
-
- if (common_config('fix', 'legacy_http')) {
- foreach ($aliases as $alias=>$id) {
- if (!strtolower(parse_url($alias, PHP_URL_SCHEME)) === 'https') {
- continue;
- }
- $aliases[preg_replace('/^https:/i', 'http:', $alias, 1)] = $id;
- }
- }
-
- return array_keys($aliases);
- }
- abstract public function updateXRD(XML_XRD $xrd);
- }
|