Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
d75b182
add zh_SC.php and fix set bug
bobwxc Apr 24, 2020
f01bc8f
add zh_TC.php
bobwxc Apr 25, 2020
9ec81bd
Merge pull request #123 from bobwxc/master
boxlabss Apr 25, 2020
2e82d45
Don't echo verification code on error
PluieElectrique Nov 4, 2020
0198e89
Added new theme
wsehl Jan 10, 2021
5efd6f8
Merge pull request #149 from wsehl/master
boxlabss Jan 10, 2021
8d16af0
Merge pull request #139 from PluieElectrique/fix-verify
boxlabss Jan 10, 2021
9b88599
round conTime for new posts up to 1 second
bunder2015 May 31, 2021
7dc7854
Include function for paste_protocol in sitemap.php
bunder2015 May 31, 2021
e302469
Fix broken query on dashboard.php
bunder2015 May 31, 2021
aa72388
Fix undefined index 'username' on user.php
bunder2015 Jun 1, 2021
24a714c
Fix cannot redeclare str_contains error
thinkverse Aug 17, 2021
ddc6eb7
Remove array access with curly braces
thinkverse Aug 17, 2021
ee6ccfc
Fix undefined method get_magic_quotes_gpc error
thinkverse Aug 17, 2021
14799a4
Fix parameter follows optional paramater
thinkverse Aug 17, 2021
8fc256b
Fix mysql error if `$last_id` is null
thinkverse Aug 17, 2021
2d4955b
Fix left over curly brackets
thinkverse Aug 17, 2021
8adf12e
Fix undefined constant error
thinkverse Aug 17, 2021
8b2686f
Fix `smtp_mail` function and references
thinkverse Aug 17, 2021
47b106d
Fix undefined variables error if no results are found
thinkverse Aug 17, 2021
ef499dd
Fix undefined method `get_magic_quotes_gpc` error
thinkverse Aug 17, 2021
cd26b68
Remove instances of `implode` calls with legacy signature
thinkverse Aug 17, 2021
b3032cf
Fix undefined variable warning
thinkverse Aug 17, 2021
1a187fd
Merge pull request #172 from thinkverse/php8-support
boxlabss Aug 17, 2021
7fb91f7
Update README.md
thinkverse Aug 17, 2021
7440848
Fix undefined index 'username'
thinkverse Aug 17, 2021
e46099e
Merge pull request #169 from bunder2015/username
thinkverse Aug 17, 2021
caeb5c0
Merge pull request #168 from bunder2015/dashboardq
thinkverse Aug 17, 2021
9e0108d
Create LICENSE
thinkverse Aug 17, 2021
3f02873
Fix admin login functionality
thinkverse Aug 17, 2021
2fcdade
Fix `conTime` throwing error when argument is less than 1
thinkverse Aug 17, 2021
f0ec3db
Merge pull request #166 from bunder2015/count
thinkverse Aug 17, 2021
ad9e17e
Update how `archive.php` handles private site settings
thinkverse Aug 17, 2021
7e4cefa
Fix "Update how `archive.php` handles private site settings"
thinkverse Aug 17, 2021
d3ece88
Delete LICENSE
thinkverse Aug 18, 2021
1cad7f7
Move functions import to top of file
thinkverse Aug 18, 2021
109ebfa
Fix unlinking of `sitemap.xml`
thinkverse Aug 18, 2021
607dea4
Merge pull request #167 from bunder2015/protocol
thinkverse Aug 18, 2021
a9a84af
Update admin login to redirect if already logged in
thinkverse Aug 18, 2021
afcf24d
Fix undefined variable warnings
thinkverse Aug 18, 2021
151ecbc
Fix edit page not filling in related page content
thinkverse Aug 18, 2021
f01e1c4
Update password reset to mimick success upon failure
thinkverse Aug 18, 2021
8126d0f
Fix paste encryption implementation
thinkverse Aug 18, 2021
fed7854
Fix XSS vulnerability when rendering raw paste
thinkverse Sep 9, 2021
2216392
Bump GeSHi to 1.0.9.1
thinkverse Sep 12, 2021
ac9946d
Update GeSHi
thinkverse Sep 12, 2021
60011a4
Fix language not being prefilled
thinkverse Sep 12, 2021
78cfde1
Move `POST` handling above presentation layer
thinkverse Sep 12, 2021
f0feba9
Update GeSHi PHP
thinkverse Sep 12, 2021
d2cb316
Update GeSHi PHP
thinkverse Sep 12, 2021
f6d621a
Add .editorconfig
thinkverse Oct 20, 2021
219d0cb
Rename GPL.txt -> LICENSE
thinkverse Oct 20, 2021
38993be
Move changelog and license
thinkverse Oct 20, 2021
6df74ff
Fix changelog location
thinkverse Oct 20, 2021
19188b0
Move changelog back
thinkverse Oct 20, 2021
9da80a9
Update install/index.php
thinkverse Oct 20, 2021
8ff5a58
Fix `conTime`
thinkverse Dec 6, 2021
5096116
Fix `conTime` InvalidArgumentException message
thinkverse Dec 6, 2021
535a672
Fix PHP 8.1 deprecation warning
thinkverse Dec 6, 2021
324dfcb
Add autosize to textarea, fix style issues on bulma theme (#186)
wsehl Dec 19, 2021
4ffe643
Paste 3.2 (#217)
boxlabss Aug 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
; This file is for unifying the coding style for different editors and IDEs.
; More information at https://editorconfig.org

root = true

[*]
charset = utf-8
indent_size = 4
indent_style = space
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false
135 changes: 92 additions & 43 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,44 @@
# Paste 2.2
Paste 3.1
=======
In progress: 3.2
* improvements
* integration of https://github.com/scrivo/highlight.php
* (geshi or highlight in config.php)
* theme picker if highlight.php enabled
* improved the layout for paste views, fixed some line number css bugs
* added a "we has cookies" footer/just comment it out in /theme/default/footer.php if not required
* live demo: https://paste.boxlabs.uk

New version 3.1
* Account deletion
* reCAPTCHA v3 with server side integration and token handling (and v2 support)
* Select reCAPTCHA in admin/configuration.php
* Select v2 or v3 depending on your keys
* Default score can be set in /includes/recaptcha.php but 0.8 will catch 99% of bots, balancing false negatives.
* Pastes and user account login/register are gated, with v3 users are no longer required to enter a captcha.
* If signed up with OAuth2, ability to change username once in /profile.php - Support more platforms in future.
* Search feature, archive/pagination
* Improved admin panel with Bootstrap 5
* Ability to add/remove admins
* Fixed SMTP for user account emails/verification - Plain SMTP server or use OAuth2 for Google Mail
* CSRF session tokens, improve security, stay logged in for 30 days with "Remember Me"
* PHP version must be 8.1 or above - time to drag Paste into the future.
* Clean up the codebase, remove obsolete functions and added more comments
* /tmp folder has gone bye bye - improved admin panel statistics, daily unique paste views

Previous version - 3.0
* PHP 8.4> compatibility
* Replace mysqli with pdo
* New default theme, upgrade paste2 theme from bootstrap 3 to 5
* Dark mode
* Admin panel changes
* Google OAuth2 SMTP/User accounts
* Security and bug fixes
* Improved installer, checks for existing database and updates schema as appropriate.
* Improved database schema
* Update Parsedown for Markdown
* All pastes encrypted in the database with AES-256 by default

[![Download PASTE](https://a.fsdn.com/con/app/sf-download-button)](https://sourceforge.net/projects/phpaste/files/latest/download)

[![Download PASTE](https://img.shields.io/sourceforge/dw/phpaste.svg)](https://sourceforge.net/projects/phpaste/files/latest/download)
Expand All @@ -9,37 +49,63 @@ The original source is available from the previous owner's **[GitHub repository]

A public version can be found **[here](https://paste.boxlabs.uk/)**

<table style="padding:10px">
<tr>
<td><img src="https://i.imgur.com/Yrjl8w1.png" align="left" alt="1" width = 279px height = 496px></td>
<td><img src="https://i.imgur.com/VleCHjh.png" alt="2" width = 288px height = 512px></td>
</tr>
</table>

IRC: If you would like support or want to contribute to Paste connect to irc.collectiveirc.net in channel #PASTE

Any bugs can be reported at:
https://github.com/jordansamuel/PASTE/issues/new

[![Frontend](http://i.imgur.com/UxZVxqo.png)](https://paste.boxlabs.uk/)
[![Frontend](http://i.imgur.com/peFanYH.png)](https://paste.boxlabs.uk/)

https://github.com/boxlabss/PASTE/issues/new

Requirements
===
* Apache 2.X / Nginx
* PHP 5.3.7 (or later) with php-openssl & GD enabled [PHP7.+ recommended]
* MySQL 5.x+
- PHP 8.1 or higher with `pdo_mysql`, `openssl`, and `curl` extensions
- MySQL or MariaDB
- Composer for dependency management
- Web server (e.g., Apache/Nginx) with HTTPS enabled (if OAuth enabled as below)

See docs/CHANGELOG
---

Install
===
* Create a database for PASTE.
* Upload all files to a webfolder
* Point your browser to http(s)://example.com/install
* Input some settings, DELETE the install folder and you're ready to go.

Manual install
===
Do the first two steps above and import the database schema using the CLI (or import via phpMyAdmin)
```
mysql -uuser -ppassword databasename < docs/paste.mysqlschema.sql
```
Move docs/config.example.php to config.php and edit
* To configure OAuth, first you need to use composer to install phpmailer and google api/oauth2 client
- Install Composer dependencies:
```bash
cd /oauth
composer require google/apiclient:^2.12 league/oauth2-client:^2.7
cd /mail
composer require phpmailer/phpmailer:^6.9
```
- Enter database details (host, name, user, password) and OAuth settings (enable or disable Google/Facebook).
- This generates `config.php` with dynamic `G_REDIRECT_URI` based on your domain.

**Set Up Google OAuth for User Logins**:
- Go to [Google Cloud Console](https://console.developers.google.com).
- Create a project and enable the Google+ API.
- Create OAuth 2.0 credentials (Web application).
- Set the Authorized Redirect URI to: `<baseurl>oauth/google.php` (e.g., `https://yourdomain.com/oauth/google.php`), where `<baseurl>` is from `site_info.baseurl`.
- Update `config.php` with:
```php
define('G_CLIENT_ID', 'your_client_id');
define('G_CLIENT_SECRET', 'your_client_secret');
```
- Ensure `enablegoog` is set to `yes` in `config.php`.
**Set Up Gmail SMTP with OAuth2**:
- In [Google Cloud Console](https://console.developers.google.com), enable the Gmail API.
- Create or reuse OAuth 2.0 credentials.
- Set the Authorized Redirect URI to: `<baseurl>oauth/google_smtp.php` (e.g., `https://yourdomain.com/oauth/google_smtp.php`), where `<baseurl>` is from `site_info.baseurl`.
- Log in to `/admin/configuration.php` as an admin.
- Enter the Client ID and Client Secret under "Google OAuth 2.0 Setup for Gmail SMTP".
- Click "Authorize Gmail SMTP" to authenticate and save the refresh token in the `mail` table.
- Configure SMTP settings (host: `smtp.gmail.com`, port: `587`, socket: `tls`, auth: `true`, protocol: `2`).

Development setup
===
Expand All @@ -55,6 +121,11 @@ Now you can start coding and send in pull requests.

Upgrading
===
3.0/3.1 schema changes
run the installer to update database
(backup first)


* 2.1 to 2.2
no changes to database

Expand All @@ -77,12 +148,12 @@ Set mod_rewrite in config.php to 1

For Apache, just use .htaccess

For Nginx, use the example config in **[docs/nginx.example.conf](https://github.com/jordansamuel/PASTE/blob/master/docs/nginx.example.conf)**
For Nginx, use the example config in **[docs/nginx.example.conf](https://github.com/boxlabss/PASTE/blob/HEAD/docs/nginx.example.conf)**

---
Changelog
===
See **[docs/CHANGELOG.md](https://github.com/jordansamuel/PASTE/blob/master/docs/CHANGELOG.md)**
See **[docs/CHANGELOG.md](https://github.com/boxlabss/PASTE/blob/HEAD/docs/CHANGELOG.md)**

---
Paste now supports pastes of upto 4GB in size, and this is configurable in config.php
Expand All @@ -97,30 +168,10 @@ However, this relies on the value of post_max_size in your PHP configuration fil
$pastelimit = "1"; // 0.5 = 512 kilobytes, 1 = 1MB
```

To enable registration with OAUTH see this block in config.php

```php
// OAUTH (to enable, change to yes and edit)
$enablefb = "no";
$enablegoog = "no";

// "CHANGE THIS" = Replace with your details
// Facebook
define('FB_APP_ID', 'CHANGE THIS'); // Your application ID, see https://developers.facebook.com/docs/apps/register
define('FB_APP_SECRET', 'CHANGE THIS'); // What's your Secret key

// Google
define('G_Client_ID', 'CHANGE THIS'); // Get a Client ID from https://console.developers.google.com/projectselector/apis/library
define('G_Client_Secret', 'CHANGE THIS'); // What's your Secret ID
define('G_Redirect_Uri', 'http://urltoyour/installation/oauth/google.php'); // Leave this as is
define('G_Application_Name', 'Paste'); // Make sure this matches the name of your application
```

Everything else can be configured using the admin panel.

---


Credits
===

Expand All @@ -129,6 +180,4 @@ Credits
* **[Viktoria Rei Bauer](https://github.com/ToeiRei)** for her contributions to the project.
* Roberto Rodriguez (roberto.rodriguez.pino[AT]gmail.com) for PostgreSQL support on v1.9.

The Paste theme was built using Bootstrap, jQuery and various jQuery plugins for
present and future features, but we do try to keep it bloat free.
Icons are provided by FontAwesome.
The Paste theme was built using Bootstrap 5
49 changes: 49 additions & 0 deletions accountdeleted.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php
/*
* Paste $v3.1 2025/08/16 https://github.com/boxlabss/PASTE
* demo: https://paste.boxlabs.uk/
*
* https://phpaste.sourceforge.io/
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 3
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License in LICENCE for more details.
*/

declare(strict_types=1);

require_once 'includes/session.php';
require_once 'config.php';
require_once 'includes/functions.php';

// DB + site info
try {
$stmt = $pdo->query("SELECT * FROM site_info WHERE id = 1");
$site = $stmt->fetch() ?: [];
} catch (Throwable $e) { $site = []; }

$baseurl = trim($site['baseurl'] ?? '');
$site_name = trim($site['site_name'] ?? 'Paste');

// Theme + language
try {
$iface = $pdo->query("SELECT * FROM interface WHERE id = 1")->fetch() ?: [];
} catch (Throwable $e) { $iface = []; }
$default_lang = trim($iface['lang'] ?? 'en.php');
$default_theme = trim($iface['theme'] ?? 'default');
require_once("langs/$default_lang");

// Page title + message (use errors.php to render)
$p_title = $lang['accountdeleted'] ?? 'Account Deleted';
$error = $lang['goodbyemsg'] ?? 'Your account and all data have been permanently removed.';

// Render with error theme
require_once("theme/$default_theme/header.php");
require_once("theme/$default_theme/errors.php");
require_once("theme/$default_theme/footer.php");
Loading