From 93ea6f41511bf7117d1170020d89c521f9ec6059 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=A9munaire?= Date: Fri, 20 Jan 2012 20:07:57 +0100 Subject: [PATCH] Fix duplication of same file and erasing of collision contents --- paste.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paste.class.php b/paste.class.php index 9f65cdf..c8127b0 100644 --- a/paste.class.php +++ b/paste.class.php @@ -108,7 +108,7 @@ class Paste } //If the file already exists, find another name if the content is different while(is_file(Paste::get_path($filename)) - && !Paste::speed_cmp(Paste::get_path($filename), $hash)); + && Paste::speed_cmp(Paste::get_path($filename), $hash)); } $this->filename = $filename; @@ -245,7 +245,7 @@ class Paste function add_answer($ref) { - if (!in_array($ref, $this->answers)) + if (!in_array($ref, $this->answers) && $ref != $this->fileref) { $this->answers[] = $ref; return true;