aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/acp/acp_styles.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2007-01-20 17:58:27 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2007-01-20 17:58:27 +0000
commit31e546c5e4ecd012ef9d93fa68f42c793e417303 (patch)
tree205934c32a9aff1bf4369b1f157d5d55abc1f3f6 /phpBB/includes/acp/acp_styles.php
parentfae887b3a106fef9fb5828f636402d5323ba300d (diff)
downloadforums-31e546c5e4ecd012ef9d93fa68f42c793e417303.tar
forums-31e546c5e4ecd012ef9d93fa68f42c793e417303.tar.gz
forums-31e546c5e4ecd012ef9d93fa68f42c793e417303.tar.bz2
forums-31e546c5e4ecd012ef9d93fa68f42c793e417303.tar.xz
forums-31e546c5e4ecd012ef9d93fa68f42c793e417303.zip
- fixing some bugs
- removing utf8 characters from email files (has been discussed internally, you guys know why) - making sure some opendir calls are checked before calling readdir. git-svn-id: file:///svn/phpbb/trunk@6912 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/acp/acp_styles.php')
-rw-r--r--phpBB/includes/acp/acp_styles.php73
1 files changed, 44 insertions, 29 deletions
diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php
index 29d38a4c19..b301f6d2ce 100644
--- a/phpBB/includes/acp/acp_styles.php
+++ b/phpBB/includes/acp/acp_styles.php
@@ -527,30 +527,35 @@ parse_css_file = {PARSE_CSS_FILE}
// Grab uninstalled items
$new_ary = $cfg = array();
- $dp = opendir("{$phpbb_root_path}styles");
- while (($file = readdir($dp)) !== false)
+ $dp = @opendir("{$phpbb_root_path}styles");
+
+ if ($dp)
{
- $subpath = ($mode != 'style') ? "$mode/" : '';
- if ($file[0] != '.' && file_exists("{$phpbb_root_path}styles/$file/$subpath$mode.cfg"))
+ while (($file = readdir($dp)) !== false)
{
- if ($cfg = file("{$phpbb_root_path}styles/$file/$subpath$mode.cfg"))
+ $subpath = ($mode != 'style') ? "$mode/" : '';
+ if ($file[0] != '.' && file_exists("{$phpbb_root_path}styles/$file/$subpath$mode.cfg"))
{
- $items = parse_cfg_file('', $cfg);
- $name = (isset($items['name'])) ? trim($items['name']) : false;
-
- if ($name && !in_array($name, $installed))
+ if ($cfg = file("{$phpbb_root_path}styles/$file/$subpath$mode.cfg"))
{
- $new_ary[] = array(
- 'path' => $file,
- 'name' => $name,
- 'copyright' => $items['copyright'],
- );
+ $items = parse_cfg_file('', $cfg);
+ $name = (isset($items['name'])) ? trim($items['name']) : false;
+
+ if ($name && !in_array($name, $installed))
+ {
+ $new_ary[] = array(
+ 'path' => $file,
+ 'name' => $name,
+ 'copyright' => $items['copyright'],
+ );
+ }
}
}
}
+ @closedir($dp);
}
+
unset($installed);
- @closedir($dp);
if (sizeof($new_ary))
{
@@ -1431,28 +1436,38 @@ parse_css_file = {PARSE_CSS_FILE}
$imagesetlist = array('nolang' => array(), 'lang' => array());
$dir = "{$phpbb_root_path}styles/$imageset_path/imageset";
- $dp = opendir($dir);
- while (($file = readdir($dp)) !== false)
+ $dp = @opendir($dir);
+
+ if ($dp)
{
- if (!is_file($dir . '/' . $file) && !is_link($dir . '/' . $file) && $file[0] != '.' && strtoupper($file) != 'CVS' && !sizeof($imagesetlist['lang']))
+ while (($file = readdir($dp)) !== false)
{
- $dp2 = opendir("$dir/$file");
- while (($file2 = readdir($dp2)) !== false)
+ if (!is_file($dir . '/' . $file) && !is_link($dir . '/' . $file) && $file[0] != '.' && strtoupper($file) != 'CVS' && !sizeof($imagesetlist['lang']))
{
- $imglang = $file;
- if (preg_match('#\.(?:gif|jpg|png)$#', $file2))
+ $dp2 = @opendir("$dir/$file");
+
+ if (!$dp2)
{
- $imagesetlist['lang'][] = "$file/$file2";
+ continue;
}
+
+ while (($file2 = readdir($dp2)) !== false)
+ {
+ $imglang = $file;
+ if (preg_match('#\.(?:gif|jpg|png)$#', $file2))
+ {
+ $imagesetlist['lang'][] = "$file/$file2";
+ }
+ }
+ closedir($dp2);
+ }
+ else if (preg_match('#\.(?:gif|jpg|png)$#', $file))
+ {
+ $imagesetlist['nolang'][] = $file;
}
- closedir($dp2);
- }
- else if (preg_match('#\.(?:gif|jpg|png)$#', $file))
- {
- $imagesetlist['nolang'][] = $file;
}
+ closedir($dp);
}
- closedir($dp);
// Make sure the list of possible images is sorted alphabetically
sort($imagesetlist['nolang']);