diff --git a/admin/index.php b/admin/index.php index a3ee63f..7f6da00 100644 --- a/admin/index.php +++ b/admin/index.php @@ -1,6 +1,6 @@ querySelectOne('SELECT user, pass FROM admin LIMIT 1'); $adminid = $row['user']; diff --git a/includes/DatabaseHandle.class.php b/includes/DatabaseHandle.class.php index 35d86c8..e7c8dc6 100644 --- a/includes/DatabaseHandle.class.php +++ b/includes/DatabaseHandle.class.php @@ -39,6 +39,6 @@ class DatabaseHandle { public function queryInsert(string $query, array $params = null) : int { $this->query($query, $params); - return (int)$this->conn->lastInsertId(); + return (int) $this->conn->lastInsertId(); } } diff --git a/includes/NonRetardedSSP.class.php b/includes/NonRetardedSSP.class.php index 96ef246..cd97271 100644 --- a/includes/NonRetardedSSP.class.php +++ b/includes/NonRetardedSSP.class.php @@ -1,4 +1,5 @@ id = (int)$row['id']; + $this->id = (int) $row['id']; $this->name = $row['name']; $this->slug = $row['slug']; } diff --git a/includes/captcha.php b/includes/captcha.php index a3915ff..79f9bbc 100644 --- a/includes/captcha.php +++ b/includes/captcha.php @@ -101,7 +101,7 @@ function captcha($color, $mode, $mul, $allowed) : array { } if (!function_exists('hex2rgb')) { - function hex2rgb($hex_str) : array | null { + function hex2rgb($hex_str) : array|null { $hex_str = preg_replace("/[^0-9A-Fa-f]/", '', $hex_str); // Gets a proper hex string if (strlen($hex_str) == 6) { diff --git a/includes/functions.php b/includes/functions.php index 6b9db26..8a532f6 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -37,10 +37,12 @@ function getreports($conn, $count = 10) { } -function tagsToHtml(string | array $tags) : string { +function tagsToHtml(string|array $tags) : string { $output = ""; if (is_array($tags)) { - $tagsSplit = array_map(function($tag) { return $tag['name']; }, $tags); + $tagsSplit = array_map(function ($tag) { + return $tag['name']; + }, $tags); } else { $tagsSplit = explode(",", $tags); } @@ -85,7 +87,7 @@ function linkify($value, $protocols = array('http', 'mail'), array $attributes = }, $value); // Extract text links for each protocol - foreach ((array)$protocols as $protocol) { + foreach ((array) $protocols as $protocol) { $value = match ($protocol) { 'http', 'https' => preg_replace_callback('~(?:(https?)://([^\s<]+)|(www\.[^\s<]+?\.[^\s<]+))(?user_id === (int)$conn->querySelectOne('SELECT user_id FROM pastes WHERE id = ?', [$_POST['paste_id']])['user_id']) { + $current_user->user_id === (int) $conn->querySelectOne('SELECT user_id FROM pastes WHERE id = ?', [$_POST['paste_id']])['user_id']) { $paste_id = intval($_POST['paste_id']); $conn->query( diff --git a/login.php b/login.php index dee7f80..a8c4a3e 100644 --- a/login.php +++ b/login.php @@ -47,7 +47,7 @@ if (isset($_POST['forgot'])) { } } elseif (isset($_POST['signin'])) { // Login process if (!empty($_POST['username']) && !empty($_POST['password'])) { - $remember_me = (bool)$_POST['remember_me']; + $remember_me = (bool) $_POST['remember_me']; $username = trim($_POST['username']); $row = $conn->query("SELECT id, password, banned FROM users WHERE username = ?", [$username]) ->fetch(); @@ -72,7 +72,7 @@ if (isset($_POST['forgot'])) { $error = $lang['banned']; } else { // Login successful - $_SESSION['user_id'] = (string)$user_id; + $_SESSION['user_id'] = (string) $user_id; if ($remember_me) { $remember_token = pp_random_token(); @@ -81,7 +81,7 @@ if (isset($_POST['forgot'])) { $conn->query('INSERT INTO user_sessions (user_id, token, expire_at) VALUES (?, ?, FROM_UNIXTIME(?))', [$user_id, $remember_token, $expire_at->format('U')]); setcookie(User::REMEMBER_TOKEN_COOKIE, $remember_token, [ - 'expires' => (int)$expire_at->format('U'), + 'expires' => (int) $expire_at->format('U'), 'secure' => !empty($_SERVER['HTTPS']), /* Local dev environment is non-HTTPS */ 'httponly' => true, 'samesite' => 'Lax' diff --git a/paste.php b/paste.php index cbb64c9..98347d0 100644 --- a/paste.php +++ b/paste.php @@ -62,12 +62,12 @@ $paste = [ 'tags' => getPasteTags($conn, $paste_id) ]; - $p_member = $row['member']; - $p_content = $row['content']; - $p_visible = $row['visible']; - $p_expiry = $row['expiry']; - $p_password = $row['password']; - $p_encrypt = (bool) $row['encrypt']; +$p_member = $row['member']; +$p_content = $row['content']; +$p_visible = $row['visible']; +$p_expiry = $row['expiry']; +$p_password = $row['password']; +$p_encrypt = (bool) $row['encrypt']; $is_private = $row['visible'] === '2'; @@ -85,7 +85,7 @@ $password_candidate = ''; if ($password_required) { if (!empty($_POST['mypass'])) { $password_candidate = $_POST['mypass']; - } else if (!empty($_GET['password'])) { + } elseif (!empty($_GET['password'])) { $password_candidate = @base64_decode($_GET['password']); } diff --git a/theme/bulma/archive.php b/theme/bulma/archive.php index 572fce5..933dcee 100644 --- a/theme/bulma/archive.php +++ b/theme/bulma/archive.php @@ -1,7 +1,7 @@ @@ -54,7 +54,7 @@ $start = $time; class="navbar-item mx-1">
@@ -355,7 +355,6 @@ CONTENT HERE! -
@@ -232,7 +232,7 @@ ' . strtoupper($p_code) . ' - + '; } @@ -264,7 +264,9 @@ $f_dateui = $f_date->format("d F Y"); $Recent_update = new DateTime($row['updated_at']); $Recent_update_u = date_format($Recent_update, 'U'); - $tagArray2 = array_map(function ($tag) { return $tag['name'];}, getPasteTags($conn, $f_id)); + $tagArray2 = array_map(function ($tag) { + return $tag['name']; + }, getPasteTags($conn, $f_id)); $f_tags = implode(',', $tagArray2); //$p_link = ($mod_rewrite == '1') ? "$f_id" : "paste.php?favdel=$fu_id"; //$f_delete_link = ($mod_rewrite == '1') ? "user.php?favdel&user=$profile_username&fid=$f_id" : "user.php?favdel&user=$profile_username&fid=$f_id"; @@ -289,13 +291,13 @@ '; - if (strlen($f_tags) > 0) { - foreach ($tagArray2 as $tags) { - echo '' . trim($tags) . ''; - } - } else { - echo ' No tags'; - } + if (strlen($f_tags) > 0) { + foreach ($tagArray2 as $tags) { + echo '' . trim($tags) . ''; + } + } else { + echo ' No tags'; + } echo ' diff --git a/theme/bulma/view.php b/theme/bulma/view.php index dfce860..5e977c8 100644 --- a/theme/bulma/view.php +++ b/theme/bulma/view.php @@ -1,7 +1,7 @@ - + '; ?>' readonly /> + echo $paste_id . '">'; ?>' readonly/> @@ -245,7 +245,7 @@ $selectedloader = "$bg[$i]"; // set variable equal to which random filename was -
+
@@ -295,7 +295,7 @@ $selectedloader = "$bg[$i]"; // set variable equal to which random filename was

+ value=""/> @@ -308,8 +308,8 @@ $selectedloader = "$bg[$i]"; // set variable equal to which random filename was @@ -346,8 +346,8 @@ $selectedloader = "$bg[$i]"; // set variable equal to which random filename was $inputtags = $paste['tags']; foreach ($inputtags as $tag) { $tagsName = ucfirst(pp_html_escape($tag['name'])); - echo ','.$tagsName.''; - }?>"> + echo ',' . $tagsName . ''; + } ?>"> @@ -412,7 +412,7 @@ $selectedloader = "$bg[$i]"; // set variable equal to which random filename was

+ placeholder=""/>