mirror of
https://github.com/Neetpone/ponepaste.git
synced 2025-03-11 14:10:06 +01:00
Upgrade highlight.php and do other stuff.
This commit is contained in:
parent
5193b4266c
commit
c238975adf
12 changed files with 39 additions and 31 deletions
|
@ -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": "*"
|
||||
|
|
16
composer.lock
generated
16
composer.lock
generated
|
@ -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",
|
||||
|
|
|
@ -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 .= "</style>";
|
||||
$output .= $content; // Paste content
|
||||
$output .= "<div class='paste_embed_footer'>";
|
||||
$output .= "<a href='https://ponepaste.org/$paste_id'>$p_title</a> Hosted by <a href='https://ponepaste.org'>$title</a> | <a href='https://ponepaste.org/raw/$paste_id'>view raw</a>";
|
||||
$output .= "<a href='{$baseurl}/{$paste_id}'>$p_title</a> Hosted by <a href='{$baseurl}'>$title</a> | <a href='{$baseurl}/raw/$paste_id'>view raw</a>";
|
||||
$output .= "</div>";
|
||||
$output .= "</div>";
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -184,6 +184,7 @@
|
|||
<div class="column">
|
||||
<div class="field">
|
||||
<label class="label" for="field_tags">Tags</label>
|
||||
<small>Type a comma to separate each tag.</small>
|
||||
<div class="control">
|
||||
<input name="tag_input" class="input js-tag-input" id="field_tags"
|
||||
value="<?= (isset($_POST['tag_input'])) ? pp_html_escape($_POST['tag_input']) : ''; ?>" />
|
||||
|
|
2
vendor/composer/autoload_psr4.php
vendored
2
vendor/composer/autoload_psr4.php
vendored
|
@ -20,7 +20,7 @@ return array(
|
|||
'Psr\\SimpleCache\\' => array($vendorDir . '/psr/simple-cache/src'),
|
||||
'Psr\\Container\\' => array($vendorDir . '/psr/container/src'),
|
||||
'PonePaste\\' => array($baseDir . '/includes'),
|
||||
'Illuminate\\Support\\' => array($vendorDir . '/illuminate/macroable', $vendorDir . '/illuminate/conditionable', $vendorDir . '/illuminate/collections', $vendorDir . '/illuminate/support'),
|
||||
'Illuminate\\Support\\' => array($vendorDir . '/illuminate/collections', $vendorDir . '/illuminate/conditionable', $vendorDir . '/illuminate/macroable', $vendorDir . '/illuminate/support'),
|
||||
'Illuminate\\Database\\' => array($vendorDir . '/illuminate/database'),
|
||||
'Illuminate\\Contracts\\' => array($vendorDir . '/illuminate/contracts'),
|
||||
'Illuminate\\Container\\' => array($vendorDir . '/illuminate/container'),
|
||||
|
|
4
vendor/composer/autoload_static.php
vendored
4
vendor/composer/autoload_static.php
vendored
|
@ -124,9 +124,9 @@ class ComposerStaticInit5bf95489f4eff2c10ec062bf7ba377da
|
|||
),
|
||||
'Illuminate\\Support\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/illuminate/macroable',
|
||||
0 => __DIR__ . '/..' . '/illuminate/collections',
|
||||
1 => __DIR__ . '/..' . '/illuminate/conditionable',
|
||||
2 => __DIR__ . '/..' . '/illuminate/collections',
|
||||
2 => __DIR__ . '/..' . '/illuminate/macroable',
|
||||
3 => __DIR__ . '/..' . '/illuminate/support',
|
||||
),
|
||||
'Illuminate\\Database\\' =>
|
||||
|
|
16
vendor/composer/installed.json
vendored
16
vendor/composer/installed.json
vendored
|
@ -830,17 +830,17 @@
|
|||
},
|
||||
{
|
||||
"name": "scrivo/highlight.php",
|
||||
"version": "v9.18.1.9",
|
||||
"version_normalized": "9.18.1.9",
|
||||
"version": "v9.18.1.10",
|
||||
"version_normalized": "9.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": {
|
||||
|
@ -850,13 +850,13 @@
|
|||
"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"
|
||||
},
|
||||
"time": "2021-12-03T06:45:28+00:00",
|
||||
"time": "2022-12-17T21:53:22+00:00",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
|
|
10
vendor/composer/installed.php
vendored
10
vendor/composer/installed.php
vendored
|
@ -3,7 +3,7 @@
|
|||
'name' => 'aftercase/ponepaste',
|
||||
'pretty_version' => 'dev-main',
|
||||
'version' => 'dev-main',
|
||||
'reference' => '8914700af7493ab2f4da22d60e13d47c410057ab',
|
||||
'reference' => '7be5984b3eea1200a34b91ba7330a415e3a61ff5',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../../',
|
||||
'aliases' => array(),
|
||||
|
@ -13,7 +13,7 @@
|
|||
'aftercase/ponepaste' => array(
|
||||
'pretty_version' => 'dev-main',
|
||||
'version' => 'dev-main',
|
||||
'reference' => '8914700af7493ab2f4da22d60e13d47c410057ab',
|
||||
'reference' => '7be5984b3eea1200a34b91ba7330a415e3a61ff5',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../../',
|
||||
'aliases' => array(),
|
||||
|
@ -149,9 +149,9 @@
|
|||
'dev_requirement' => false,
|
||||
),
|
||||
'scrivo/highlight.php' => array(
|
||||
'pretty_version' => 'v9.18.1.9',
|
||||
'version' => '9.18.1.9',
|
||||
'reference' => 'd45585504777e6194a91dffc7270ca39833787f8',
|
||||
'pretty_version' => 'v9.18.1.10',
|
||||
'version' => '9.18.1.10',
|
||||
'reference' => '850f4b44697a2552e892ffe71490ba2733c2fc6e',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../scrivo/highlight.php',
|
||||
'aliases' => array(),
|
||||
|
|
|
@ -48,6 +48,12 @@ class RegExMatch implements \ArrayAccess, \Countable, \IteratorAggregate
|
|||
/** @var string */
|
||||
public $input;
|
||||
|
||||
/** @var string */
|
||||
public $type;
|
||||
|
||||
/** @var Mode|string */
|
||||
public $rule;
|
||||
|
||||
/**
|
||||
* @param array<int, string|null> $results
|
||||
*/
|
||||
|
|
|
@ -111,7 +111,6 @@ final class Terminators
|
|||
|
||||
if (is_string($rule)) {
|
||||
$match->type = $rule;
|
||||
$match->extra = array($this->mode->illegal, $this->mode->terminator_end);
|
||||
} else {
|
||||
$match->type = "begin";
|
||||
$match->rule = $rule;
|
||||
|
|
4
vendor/scrivo/highlight.php/composer.json
vendored
4
vendor/scrivo/highlight.php/composer.json
vendored
|
@ -52,8 +52,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"
|
||||
|
|
Loading…
Add table
Reference in a new issue