diff options
author | Claude <longneck@scratchbook.ch> | 2019-11-24 12:15:27 +0100 |
---|---|---|
committer | Claude <longneck@scratchbook.ch> | 2019-11-24 12:15:27 +0100 |
commit | 59573236d67bd9b9738950e8b417ed316d1ae87d (patch) | |
tree | 383152069be2effd1f7fee790d6590485ad5789a | |
parent | 26cd691cea0057de666a05db3a1fc4ae9dba5edf (diff) | |
download | stikked-fit-59573236d67bd9b9738950e8b417ed316d1ae87d.tar.gz stikked-fit-59573236d67bd9b9738950e8b417ed316d1ae87d.tar.bz2 stikked-fit-59573236d67bd9b9738950e8b417ed316d1ae87d.zip |
force private on previously encrypted pastes
-rw-r--r-- | htdocs/application/models/Pastes.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/htdocs/application/models/Pastes.php b/htdocs/application/models/Pastes.php index bdffd1d..ce52f91 100644 --- a/htdocs/application/models/Pastes.php +++ b/htdocs/application/models/Pastes.php @@ -56,6 +56,11 @@ class Pastes extends CI_Model } $data['private'] = ($this->input->post('private') === null ? '0' : $this->input->post('private')); + // force private when a previously encrypted paste gets pasted publicly + if (preg_match('/^U2FsdGVkX1/', $data['raw'])) { + $data['private'] = 1; + } + do { $data['pid'] = substr(md5(md5(mt_rand(0, 1000000) . time())), rand(0, 24), 8); $this->db->select('id'); |