Index: branches/5.2.x/core/units/helpers/fck_helper.php =================================================================== diff -u -N -r14699 -r14843 --- branches/5.2.x/core/units/helpers/fck_helper.php (.../fck_helper.php) (revision 14699) +++ branches/5.2.x/core/units/helpers/fck_helper.php (.../fck_helper.php) (revision 14843) @@ -1,6 +1,6 @@ getFilename(); @@ -138,8 +143,13 @@ { $ret = Array (); - $iterator = new DirectoryIterator($files_dir); - /* @var $file_info DirectoryIterator */ + try { + $iterator = new DirectoryIterator($files_dir); + /* @var $file_info DirectoryIterator */ + } + catch (UnexpectedValueException $e) { + return $ret; + } foreach ($iterator as $file_info) { if ( !$file_info->isDir() ) { Index: branches/5.2.x/core/units/helpers/themes_helper.php =================================================================== diff -u -N -r14753 -r14843 --- branches/5.2.x/core/units/helpers/themes_helper.php (.../themes_helper.php) (revision 14753) +++ branches/5.2.x/core/units/helpers/themes_helper.php (.../themes_helper.php) (revision 14843) @@ -1,6 +1,6 @@ themesFolder . '/'); - /* @var $file_info DirectoryIterator */ + try { + $iterator = new DirectoryIterator($this->themesFolder . '/'); + /* @var $file_info DirectoryIterator */ - foreach ($iterator as $file_info) { - $filename = $file_info->getFilename(); + foreach ($iterator as $file_info) { + $filename = $file_info->getFilename(); - if ( $file_info->isDir() && !$file_info->isDot() && $filename != '.svn' && $filename != 'CVS' ) { - $theme_id = $this->refreshTheme($filename); + if ( $file_info->isDir() && !$file_info->isDot() && $filename != '.svn' && $filename != 'CVS' ) { + $theme_id = $this->refreshTheme($filename); - if ($theme_id) { - $themes_found[] = $theme_id; - // increment serial of updated themes - $this->Application->incrementCacheSerial('theme', $theme_id); + if ( $theme_id ) { + $themes_found[] = $theme_id; + // increment serial of updated themes + $this->Application->incrementCacheSerial('theme', $theme_id); + } } } } + catch ( UnexpectedValueException $e ) { + } $id_field = $this->Application->getUnitOption('theme', 'IDField'); $table_name = $this->Application->getUnitOption('theme', 'TableName'); @@ -510,10 +514,10 @@ }*/ // 2. if none themes found -> delete all from db OR delete all except of found themes - $sql = 'SELECT '.$id_field.' - FROM '.$table_name; - if ($themes_found) { - $sql .= ' WHERE '.$id_field.' NOT IN ('.implode(',', $themes_found).')'; + $sql = 'SELECT ' . $id_field . ' + FROM ' . $table_name; + if ( $themes_found ) { + $sql .= ' WHERE ' . $id_field . ' NOT IN (' . implode(',', $themes_found) . ')'; } $theme_ids = $this->Conn->GetCol($sql); $this->deleteThemes($theme_ids); Index: branches/5.2.x/core/install.php =================================================================== diff -u -N -r14842 -r14843 --- branches/5.2.x/core/install.php (.../install.php) (revision 14842) +++ branches/5.2.x/core/install.php (.../install.php) (revision 14843) @@ -1,6 +1,6 @@ toolkit->RunSQL( $template_path . '_install/install_data.sql', Array('{ThemeId}', '{SitePath}'), Array($theme_id, $site_path) ); - // copy theme demo images into writable path accessible by FCKEditor - $file_helper->copyFolderRecursive(FULL_PATH . $template_path . '_install/images' . DIRECTORY_SEPARATOR, WRITEABLE . '/user_files/Images'); + if ( file_exists(FULL_PATH . $template_path . '_install/images') ) { + // copy theme demo images into writable path accessible by FCKEditor + $file_helper->copyFolderRecursive(FULL_PATH . $template_path . '_install/images' . DIRECTORY_SEPARATOR, WRITEABLE . '/user_files/Images'); + } } } break; Index: branches/5.2.x/core/units/helpers/modules_helper.php =================================================================== diff -u -N -r14699 -r14843 --- branches/5.2.x/core/units/helpers/modules_helper.php (.../modules_helper.php) (revision 14699) +++ branches/5.2.x/core/units/helpers/modules_helper.php (.../modules_helper.php) (revision 14843) @@ -1,6 +1,6 @@ getPathname();