Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21894
Modified Files:
serendipity_xmlrpc.php
Log Message:
create possibly non-existant directories. thanks to Heinz Stampfli!
Index: serendipity_xmlrpc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_xmlrpc.php,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- serendipity_xmlrpc.php 19 Nov 2004 11:05:20 -0000 1.20
+++ serendipity_xmlrpc.php 17 Jan 2005 19:16:54 -0000 1.21
@@ -451,7 +451,13 @@
return new XML_RPC_Response('', 4, 'Authentication Failed');
}
- $fp = fopen($serendipity['serendipityPath'] . $serendipity['uploadPath'] . $struct['name'], 'w');
+ $full = $serendipity['serendipityPath'] . $serendipity['uploadPath'] . $struct['name'];
+
+ if (!is_dir(dirname($full))) {
+ @mkdir(dirname($full));
+ }
+
+ $fp = fopen($full, 'w');
fwrite($fp, $struct['bits']);
fclose($fp);
$path = $serendipity['baseURL'] . $serendipity['uploadPath'] . $struct['name'];
|