]> source.dussan.org Git - nextcloud-server.git/commitdiff
check if the tempfile was created successfully
authorGeorg Ehrke <dev@georgswebsite.de>
Thu, 23 Feb 2012 17:23:09 +0000 (18:23 +0100)
committerGeorg Ehrke <dev@georgswebsite.de>
Thu, 23 Feb 2012 17:23:09 +0000 (18:23 +0100)
lib/db.php

index 9d3c20e0145873808af24e2ba01f880bc61b2235..4c17cd0dbd16f2b1ccd21f901ee0121f61262645 100644 (file)
@@ -318,6 +318,9 @@ class OC_DB {
                
                // Make changes and save them to a temporary file
                $file2 = tempnam( get_temp_dir(), 'oc_db_scheme_' );
+               if($file2 == ''){
+                       die('could not create tempfile in get_temp_dir() - aborting');
+               }
                $content = str_replace( '*dbname*', $CONFIG_DBNAME, $content );
                $content = str_replace( '*dbprefix*', $CONFIG_DBTABLEPREFIX, $content );
                if( $CONFIG_DBTYPE == 'pgsql' ){ //mysql support it too but sqlite doesn't