From 9f260bc233c5c481451a7f4be3a6ac6d16073288 Mon Sep 17 00:00:00 2001 From: V Selvamuthukumar <v.selvamuthukumar@gmail.com> Date: Tue, 27 Mar 2018 12:33:03 +0200 Subject: [PATCH] Make sure each ImageAttribute is set in different session variables --- include/simpleplugin/attributes/class_FileAttribute.inc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/simpleplugin/attributes/class_FileAttribute.inc b/include/simpleplugin/attributes/class_FileAttribute.inc index 20de46d5c..6d4def2bd 100644 --- a/include/simpleplugin/attributes/class_FileAttribute.inc +++ b/include/simpleplugin/attributes/class_FileAttribute.inc @@ -310,9 +310,10 @@ class ImageAttribute extends FileAttribute $id = $this->getHtmlId(); // Just to be sure the image is not cached srand((double)microtime() * 1000000); + $key = $this->getLdapName().rand(0,10000); $display = '<img id="'.$id.'_img"'. - ($this->disabled? 'disabled="disabled"':''). - ' src="getbin.php?rand='.rand(0, 10000).'"'. + ($this->disabled ? 'disabled="disabled"' : ''). + ' src="getbin.php?key='.$key.'"'. ' style="border:1px solid black;"'. ' alt="'.$this->getDescription().'"'. ' title="'.$this->getDescription().'"'. @@ -339,9 +340,9 @@ class ImageAttribute extends FileAttribute ); } if (($this->getValue() == '') && ($this->placeholder != '')) { - session::set('binary', $this->placeholder); + session::set('binary'.$key, $this->placeholder); } else { - session::set('binary', $this->getValue()); + session::set('binary'.$key, $this->getValue()); } session::set('binarytype', 'image/'.$this->format); return $this->renderAcl($display); -- GitLab