]> source.dussan.org Git - nextcloud-server.git/commitdiff
require base lib and deal with malformed user addresses in webfinger.php
authorMichiel de Jong <michiel@unhosted.org>
Mon, 7 May 2012 07:46:15 +0000 (09:46 +0200)
committerMichiel de Jong <michiel@unhosted.org>
Mon, 7 May 2012 07:46:15 +0000 (09:46 +0200)
apps/user_webfinger/webfinger.php

index e702f27b56e64dd610e8a6898f8508e070518f9a..7c59c53afece943f55f7cf58a57a2e19efeb4f5f 100755 (executable)
@@ -25,15 +25,17 @@ $SUBURI=substr(realpath($_SERVER["SCRIPT_FILENAME"]),strlen($SERVERROOT));
 $WEBROOT=substr($SUBURI,0,-34);
 */
 
+require_once('../../lib/base.php');
 
+$userName = '';
+$hostName = '';
 $request = strip_tags(urldecode($_GET['q']));
 if($_GET['q']) {
        $reqParts = explode('@', $request);
-       $userName = $reqParts[0];
-       $hostName = $reqParts[1];
-} else {
-       $userName = '';
-       $hostName = '';
+       if(count($reqParts)==2) {
+    $userName = $reqParts[0];
+         $hostName = $reqParts[1];
+  }
 }
 if(substr($userName, 0, 5) == 'acct:') {
        $userName = substr($userName, 5);