dir.'); if (preg_match('/^[a-z0-9]{1,32}$/D', $_POST['subdomain']) !== 1) output(403, _('Invalid domain label.')); if (query('select', 'sites', ['address' => $_POST['subdomain'], 'type' => 'subdomain']) !== []) output(403, _('This domain already exists on this service. Use another one.')); rateLimit(); addSite($_SESSION['id'], $_POST['dir'], $_POST['subdomain'], 'subdomain'); if (symlink(CONF['ht']['ht_path'] . '/' . $_SESSION['id'] . '/' . $_POST['dir'], CONF['ht']['subdomain_path'] . '/' . $_POST['subdomain']) !== true) output(500, 'Unable to create symlink.'); output(200, sprintf(_('%s added on this directory.'), PAGE_METADATA['title']));