Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Extra theme check.

This ensures that if a collection-specific theme is unavailable for
whatever reason the default active theme will be used (instead of just
breaking everything).
  • Loading branch information...
commit 8812253cc6bc35f875c0c86955d29ec5179c76e0 1 parent 798a187
Michael Sisk authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 webcomic.php
View
4 webcomic.php
@@ -574,7 +574,7 @@ public function template_redirect() {
* @hook template
*/
public function template( $theme ) {
- return ( self::$collection and self::$config[ 'collections' ][ self::$collection ][ 'theme' ] ) ? substr( self::$config[ 'collections' ][ self::$collection ][ 'theme' ], 0, strpos( self::$config[ 'collections' ][ self::$collection ][ 'theme' ], '|' ) ) : $theme;
+ return ( self::$collection and self::$config[ 'collections' ][ self::$collection ][ 'theme' ] and $template = substr( self::$config[ 'collections' ][ self::$collection ][ 'theme' ], 0, strpos( self::$config[ 'collections' ][ self::$collection ][ 'theme' ], '|' ) ) and is_readable( get_theme_root() . "/{$template}" ) ) ? $template : $theme;
}
/** Return the appropriate theme ID for custom collection themes.
@@ -586,7 +586,7 @@ public function template( $theme ) {
* @hook stylesheet
*/
public function stylesheet( $theme ) {
- return ( self::$collection and self::$config[ 'collections' ][ self::$collection ][ 'theme' ] ) ? substr( self::$config[ 'collections' ][ self::$collection ][ 'theme' ], strpos( self::$config[ 'collections' ][ self::$collection ][ 'theme' ], '|' ) + 1 ) : $theme;
+ return ( self::$collection and self::$config[ 'collections' ][ self::$collection ][ 'theme' ] and $stylesheet = substr( self::$config[ 'collections' ][ self::$collection ][ 'theme' ], strpos( self::$config[ 'collections' ][ self::$collection ][ 'theme' ], '|' ) + 1 ) and is_readable( get_theme_root() . "/{$stylesheet}" ) ) ? $stylesheet : $theme;
}
/** Integrate webcomics into the main site feed.
Please sign in to comment.
Something went wrong with that request. Please try again.