getAliases for Profile and Notice

Also move fancyurlfix into site-wide $config['fix']['fancyurls']

TODO: getByUri should make use of this directly I guess?
This commit is contained in:
Mikael Nordfeldth
2016-02-23 14:00:59 +01:00
parent 5f7032dfee
commit b59dacb806
4 changed files with 63 additions and 44 deletions

View File

@@ -36,12 +36,10 @@ class WebFingerPlugin extends Plugin
const OAUTH_AUTHORIZE_REL = 'http://apinamespace.org/oauth/authorize';
public $http_alias = false;
public $fancyurlfix = true; // adds + interprets some extra aliases related to 'index.php/' URLs
public function initialize()
{
common_config_set('webfinger', 'http_alias', $this->http_alias);
common_config_set('webfinger', 'fancyurlfix', $this->fancyurlfix);
}
public function onRouterInitialized($m)
@@ -106,7 +104,7 @@ class WebFingerPlugin extends Plugin
$user = User::getByUri($resource);
$profile = $user->getProfile();
} catch (NoResultException $e) {
if (common_config('webfinger', 'fancyurlfix')) {
if (common_config('fix', 'fancyurls')) {
try {
try { // if it's a /index.php/ url
// common_fake_local_fancy_url can throw an exception