projects
/
Pman.Core
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Process/Php7.php
[Pman.Core]
/
Images.php
diff --git
a/Images.php
b/Images.php
index
be02d68
..
54984b9
100644
(file)
--- a/
Images.php
+++ b/
Images.php
@@
-2,6
+2,9
@@
/**
* Deal with image delivery and HTML replacement of image links in body text.
*
/**
* Deal with image delivery and HTML replacement of image links in body text.
*
+ *
+ * NOTE THIS WAS NEVER INTENDED FOR PUBLIC IMAGE DISTRIBUTION - we need to create a seperate file for that...
+ *
* $str = Pman_Core_Images::replaceImg($str); // < use with HTML
*
* or
* $str = Pman_Core_Images::replaceImg($str); // < use with HTML
*
* or
@@
-178,7
+181,7
@@
class Pman_Core_Images extends Pman
$img = DB_DataObjecT::factory('Images');
if (!$id || !$img->get($id)) {
$img = DB_DataObjecT::factory('Images');
if (!$id || !$img->get($id)) {
-
$this->imgErr("image has been removed or deleted.",$s);
+ $this->imgErr("image has been removed or deleted.",$s);
}
if (!$this->authUser && !in_array($img->ontable,$this->public_image_tables)) {
}
if (!$this->authUser && !in_array($img->ontable,$this->public_image_tables)) {
@@
-522,7
+525,6
@@
class Pman_Core_Images extends Pman
function downloadEvent($bits)
{
function downloadEvent($bits)
{
- $popts = PEAR::getStaticProperty('Pman','options');
$ev = DB_DAtaObject::Factory('events');
if (!$ev->get($bits[1])) {
die("could not find event id");
$ev = DB_DAtaObject::Factory('events');
if (!$ev->get($bits[1])) {
die("could not find event id");
@@
-535,18
+537,23
@@
class Pman_Core_Images extends Pman
$user = getenv('USERNAME'); // windows.
}
$ff = HTML_FlexyFramework::get();
$user = getenv('USERNAME'); // windows.
}
$ff = HTML_FlexyFramework::get();
- $file = $ff->Pman['event_log_dir']. '/'. $user. date('/Y/m/d/',strtotime($ev->event_when)). $ev->id . ".json";
+
+ $file = $ev->logDir() . date('/Y/m/d/',strtotime($ev->event_when)). $ev->id . ".json";
+
+ if(!$file || !file_exists($file)){
+ die("file was not saved");
+ }
+
$filesJ = json_decode(file_get_contents($file));
$filesJ = json_decode(file_get_contents($file));
- //print_r($filesJ);
-
foreach($filesJ->FILES as $k=>$f){
if ($f->tmp_name != $bits[2]) {
continue;
}
foreach($filesJ->FILES as $k=>$f){
if ($f->tmp_name != $bits[2]) {
continue;
}
- $src = $ff->Pman['event_log_dir']. '/'. $user. date('/Y/m/d/', strtotime($ev->event_when)). $f->tmp_name ;
- if (!file_exists($src)) {
+ $src = $file = $ev->logDir() . date('/Y/m/d/', strtotime($ev->event_when)). $f->tmp_name ;
+
+ if (!$src || !file_exists($src)) {
die("file was not saved");
}
header ('Content-Type: ' . $f->type);
die("file was not saved");
}
header ('Content-Type: ' . $f->type);