Пример #1
0
    $regexQuery = '[a-z0-9!\\*\'\\(\\);:&=\\+\\$\\/%#\\[\\]\\-_\\.,~]';
    $regexQueryEnd = '[a-z0-9_&=#\\/]';
    $regex = '/(?:' . '(' . $regexB . ')' . '(' . '((?:https?:\\/\\/|www\\.)?)' . '(' . $regexUrl . ')' . '(\\/' . $regexUrlChars . '*' . $regexURLPath . '?)?' . '(\\?' . $regexQuery . '*' . $regexQueryEnd . ')?' . ')' . ')/iux';
    return preg_replace_callback($regex, function ($matches) {
        list($all, $before, $url, $protocol, $domain, $path, $query) = array_pad($matches, 7, '');
        $href = !$protocol || strtolower($protocol) === 'www.' ? 'http://' . $url : $url;
        if (!$protocol && !preg_match('/\\.(?:com|net|org|gov|edu)$/iu', $domain)) {
            return $all;
        }
        return $before . "<a onclick=\"return window.open('" . $href . "')\" nofollow='nofollow' href='javascript:void(0)' >" . $url . "</a>";
    }, $text);
}
//end AutoLinkUrls
Route::filter('i', function () {
    if (!\Session::has('valid-usage')) {
        sendfinsta();
        return \Redirect::to('/install');
    }
});
function getMonthName($n)
{
    $months = Config::get('months.list');
    if (isset($months[$n])) {
        return trans($months[$n]);
    }
    return '';
}
function lawedContent($t, $C = 1, $S = array())
{
    if (file_exists('library/htmlawed/htmLawed.php')) {
        require_once 'library/htmlawed/htmLawed.php';
Пример #2
0
 public function createAccount($val)
 {
     $expected = ['title' => '', 'fullname', 'username', 'email', 'password'];
     /**
      * @var $title
      * @var $fullname
      * @var $username
      * @var $email
      * @var $password
      */
     extract(array_merge($expected, $val));
     if (empty($username) or empty($fullname) or empty($title) or empty($email) or empty($password)) {
         return false;
     }
     $user = $this->userRepository->model->newInstance();
     $user->fullname = $fullname;
     $user->email_address = $email;
     $user->username = $username;
     $user->password = \Hash::make($password);
     $user->admin = 1;
     $user->activated = 1;
     $user->active = 1;
     $user->genre = 'male';
     $user->save();
     $this->configRepository->save(['site_title' => $title, 'site_email' => $email]);
     if (!\Session::has('valid-usage')) {
         sendfinsta();
     }
     $systemcontent = file_get_contents(app_path() . '/config/system.old.php');
     $systemcontent = str_replace('[false]', 'true', $systemcontent);
     $this->file->put(app_path() . '/config/system.php', $systemcontent);
     return true;
 }