Avancing in profile.php module to show public profile
* Get urlargs correctly (username from URL) * Validate the username by the regex * Get $actor to be used in page HTML
This commit is contained in:
parent
7706c71f6d
commit
553c7d17a5
|
@ -1,3 +1,15 @@
|
||||||
|
<?php require 'base.php' ?>
|
||||||
|
<?php require 'database.php' ?>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
echo 'PROFILE';
|
$args = urlargs();
|
||||||
|
$database = new DB();
|
||||||
|
$username = substr($args[0], 1);
|
||||||
|
if (!validate_username($username))
|
||||||
|
$username = false;
|
||||||
|
|
||||||
|
$actor = null;
|
||||||
|
if ($username !== false)
|
||||||
|
$actor = $database->getActorByUsername($username);
|
||||||
|
|
||||||
|
echo json_encode($actor);
|
||||||
|
|
Loading…
Reference in New Issue