From c238975adf0473c7edd7ed392b8044a0df865a59 Mon Sep 17 00:00:00 2001 From: Floorb <132411956+Neetpone@users.noreply.github.com> Date: Sat, 25 Feb 2023 05:03:19 -0500 Subject: [PATCH] Upgrade highlight.php and do other stuff. --- composer.json | 2 +- composer.lock | 16 ++++++++-------- includes/functions.php | 4 +++- public/paste.php | 4 ++-- theme/bulma/main.php | 1 + vendor/composer/autoload_psr4.php | 2 +- vendor/composer/autoload_static.php | 4 ++-- vendor/composer/installed.json | 16 ++++++++-------- vendor/composer/installed.php | 10 +++++----- .../highlight.php/Highlight/RegExMatch.php | 6 ++++++ .../highlight.php/Highlight/Terminators.php | 1 - vendor/scrivo/highlight.php/composer.json | 4 ++-- 12 files changed, 39 insertions(+), 31 deletions(-) diff --git a/composer.json b/composer.json index a4281d5..0f49d40 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ "ext-openssl": "*", "ext-gd": "*", "ext-mbstring": "*", - "scrivo/highlight.php": "v9.18.1.9", + "scrivo/highlight.php": "^9.18", "erusev/parsedown": "^1.7", "illuminate/database": "^9.4", "ext-redis": "*" diff --git a/composer.lock b/composer.lock index 0d7d67f..105d72e 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "bc050acf9c5c5997281c5c3a6f33c811", + "content-hash": "e4f29c3440a94cc63c1b5d37ca4f76e8", "packages": [ { "name": "brick/math", @@ -797,16 +797,16 @@ }, { "name": "scrivo/highlight.php", - "version": "v9.18.1.9", + "version": "v9.18.1.10", "source": { "type": "git", "url": "https://github.com/scrivo/highlight.php.git", - "reference": "d45585504777e6194a91dffc7270ca39833787f8" + "reference": "850f4b44697a2552e892ffe71490ba2733c2fc6e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/scrivo/highlight.php/zipball/d45585504777e6194a91dffc7270ca39833787f8", - "reference": "d45585504777e6194a91dffc7270ca39833787f8", + "url": "https://api.github.com/repos/scrivo/highlight.php/zipball/850f4b44697a2552e892ffe71490ba2733c2fc6e", + "reference": "850f4b44697a2552e892ffe71490ba2733c2fc6e", "shasum": "" }, "require": { @@ -816,8 +816,8 @@ "require-dev": { "phpunit/phpunit": "^4.8|^5.7", "sabberworm/php-css-parser": "^8.3", - "symfony/finder": "^2.8|^3.4", - "symfony/var-dumper": "^2.8|^3.4" + "symfony/finder": "^2.8|^3.4|^5.4", + "symfony/var-dumper": "^2.8|^3.4|^5.4" }, "suggest": { "ext-mbstring": "Allows highlighting code with unicode characters and supports language with unicode keywords" @@ -871,7 +871,7 @@ "type": "github" } ], - "time": "2021-12-03T06:45:28+00:00" + "time": "2022-12-17T21:53:22+00:00" }, { "name": "symfony/console", diff --git a/includes/functions.php b/includes/functions.php index 6c2d848..4856a04 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -149,6 +149,8 @@ function truncate(string $input, int $maxWords, int $maxChars) : string { } function embedView($paste_id, $p_title, $content, $title) : bool { + global $baseurl; + $stats = false; if ($content) { // Build the output @@ -200,7 +202,7 @@ function embedView($paste_id, $p_title, $content, $title) : bool { $output .= ""; $output .= $content; // Paste content $output .= "
"; $output .= ""; diff --git a/public/paste.php b/public/paste.php index e7f0b78..708eacf 100644 --- a/public/paste.php +++ b/public/paste.php @@ -125,7 +125,7 @@ if (PP_MOD_REWRITE) { } /* Expiry */ -if (!empty($paste->expiry)) { +if (!empty($paste->expiry) && $paste->expiry !== 'NULL') { if ($paste->expiry === 'SELF') { $paste->delete(); flashWarning('This paste has self-destructed - if you close this window, you will no longer be able to view it!'); @@ -186,7 +186,7 @@ $p_content = rtrim($p_content); // Apply syntax highlight $p_content = htmlspecialchars_decode($p_content); -if ($paste_code === "pastedown") { +if ($paste_code === "pastedown" || $paste_code === 'pastedown_old') { $parsedown = new Parsedown(); $parsedown->setSafeMode(true); $p_content = $parsedown->text($p_content); diff --git a/theme/bulma/main.php b/theme/bulma/main.php index 7164b32..0dc9cf8 100644 --- a/theme/bulma/main.php +++ b/theme/bulma/main.php @@ -184,6 +184,7 @@