projects
/
Pman.Core
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4f08a4e
)
fix shorten name modifying filename - which it should not do.
author
Alan
<alan@roojs.com>
Wed, 8 Feb 2023 03:35:33 +0000
(11:35 +0800)
committer
Alan
<alan@roojs.com>
Wed, 8 Feb 2023 03:35:33 +0000
(11:35 +0800)
DataObjects/Images.php
patch
|
blob
|
history
Images.php
patch
|
blob
|
history
diff --git
a/DataObjects/Images.php
b/DataObjects/Images.php
index
51ba52d
..
537a68f
100644
(file)
--- a/
DataObjects/Images.php
+++ b/
DataObjects/Images.php
@@
-203,7
+203,7
@@
class Pman_Core_DataObjects_Images extends DB_DataObject
function getStoreName()
{
$opts = HTML_FlexyFramework::get()->Pman;
function getStoreName()
{
$opts = HTML_FlexyFramework::get()->Pman;
- $fn = preg_replace('/[^a-z0-9\.]+/i', '_', $this->filename);
+ $fn = preg_replace('/[^a-z0-9
_
\.]+/i', '_', $this->filename);
return implode( '/', array(
$opts['storedir'], '_images_', date('Y/m', strtotime($this->created)), $this->id . '-'. $fn
));
return implode( '/', array(
$opts['storedir'], '_images_', date('Y/m', strtotime($this->created)), $this->id . '-'. $fn
));
@@
-215,6
+215,8
@@
class Pman_Core_DataObjects_Images extends DB_DataObject
*/
function exists()
{
*/
function exists()
{
+ clearstatcache();
+ //var_dump($this->getStoreName());
return file_exists($this->getStoreName());
}
return file_exists($this->getStoreName());
}
@@
-503,7
+505,7
@@
class Pman_Core_DataObjects_Images extends DB_DataObject
}
}
- $ret['shorten_name']
= $ret['filename']
= $this->shorten_name();
+ $ret['shorten_name']
= $this->shorten_name();
return $ret;
}
return $ret;
}
diff --git
a/Images.php
b/Images.php
index
92e40db
..
ee9b968
100644
(file)
--- a/
Images.php
+++ b/
Images.php
@@
-184,6
+184,7
@@
class Pman_Core_Images extends Pman
$img = DB_DataObjecT::factory('Images');
if (!$id || !$img->get($id) || !$img->exists()) {
$img = DB_DataObjecT::factory('Images');
if (!$id || !$img->get($id) || !$img->exists()) {
+ //print_r($img); die("HERE");
$this->imgErr("image has been removed or deleted.",$s);
}
$this->imgErr("image has been removed or deleted.",$s);
}