Skip to content

Commit

Permalink
Fix skin extending for assets (#5115)
Browse files Browse the repository at this point in the history
Remove redundant is_file() calls.
  • Loading branch information
alecpl committed Apr 15, 2018
1 parent 5ce5f9a commit ecde987
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Expand Up @@ -68,6 +68,7 @@ CHANGELOG Roundcube Webmail
- Handle inline images also inside multipart/mixed messages (#5905)
- Allow style tags in HTML editor on composed/reply messages (#5751)
- Use Github API as a fallback to fetch js dependencies to workaround throttling issues (#6248)
- Fix skin extending for assets (#5115)
- Fix handling of forwarded messages inside of a TNEF message (#5632)
- Fix bug where attachment size wasn't visible when the filename was too long (#6033)
- Fix checking table columns when there's more schemas/databases in postgres/mysql (#6047)
Expand Down
11 changes: 4 additions & 7 deletions program/include/rcmail_output_html.php
Expand Up @@ -349,16 +349,12 @@ public function get_skin_file($file, &$skin_path = null, $add_path = null)
}

foreach ($skin_paths as $skin_path) {
$path = realpath(RCUBE_INSTALL_PATH . $skin_path . $file);

if ($path && is_file($path)) {
if (realpath(RCUBE_INSTALL_PATH . $skin_path . $file)) {
return $skin_path . $file;
}

if ($this->assets_dir != RCUBE_INSTALL_PATH) {
$path = realpath($this->assets_dir . $skin_path . $file);

if ($path && is_file($path)) {
if (realpath($this->assets_dir . $skin_path . $file)) {
return $skin_path . $file;
}
}
Expand Down Expand Up @@ -833,7 +829,8 @@ protected function file_callback($matches)

// correct absolute paths
if ($file[0] == '/') {
$file = $this->base_path . $file;
$this->get_skin_file($file, $skin_path);

This comment has been minimized.

Copy link
@dsoares

dsoares Apr 19, 2018

Contributor

$skin_path is unknown in the scope of this function

This comment has been minimized.

Copy link
@alecpl

alecpl Apr 19, 2018

Author Member

That is not a problem, it will be filled with the skin path by reference.

$file = $skin_path . $file;
}

// add file modification timestamp
Expand Down

0 comments on commit ecde987

Please sign in to comment.