From: Kromann, F. <Fra...@fn...> - 2007-01-10 22:46:21
|
Hello Everyone, While working on an issue with article images I noticed that article_image.php uses this way to calculate the path to the cached image: 1.9.7: $topiccachefile =3D "temp"; if ($tikidomain) { $topiccachefile.=3D "/$tikidomain"; } $topiccachefile.=3D "/article.".$_REQUEST["id"]; CVS Head: $topiccachefile =3D $tikilib->get_preference("tmpdir", "temp"); if ($tikidomain) { $topiccachefile.=3D "/$tikidomain"; } $topiccachefile.=3D "/article.".$_REQUEST["id"]; And when you upload a new image to an article the cached version will be deleted at this location: @unlink("temp/article.$articleId"); With no reference to the $tikidomain vaiable. Here is a suggested patch against CVS head: Index: tiki-edit_article.php =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/tikiwiki/tiki/tiki-edit_article.php,v retrieving revision 1.59 diff -u -r1.59 tiki-edit_article.php --- tiki-edit_article.php 4 Dec 2006 09:20:08 -0000 1.59 +++ tiki-edit_article.php 10 Jan 2007 22:45:25 -0000 @@ -340,7 +340,10 @@ $imgtype =3D $_FILES['userfile1']['type']; $imgsize =3D $_FILES['userfile1']['size']; $imgname =3D $_FILES['userfile1']['name']; - @unlink("temp/article.$articleId"); + $topiccachefile =3D $tikilib->get_preference("tmpdir", "temp"); + if ($tikidomain) { $topiccachefile.=3D "/$tikidomain"; } + $topiccachefile.=3D "/article.".$_REQUEST["id"]; + @unlink($topiccachefile); } // Parse $edit and eliminate image references to external URIs (make them internal) - Frank |