Skip to content

Commit 59fea4d

Browse files
committed
fix(styles): default 'Block user-imported styles' to OFF
Matches upstream eXeLearning ONLINE_THEMES_INSTALL=true, so existing installs and new ones preserve the familiar behavior (imports allowed). Admins now opt-in to the lockdown from the Styles page instead of being opted in silently.
1 parent 3778573 commit 59fea4d

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

includes/class-styles-service.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ public static function build_theme_registry_override() {
264264
public static function is_import_blocked() {
265265
$value = get_option( self::OPTION_BLOCK_IMPORT, null );
266266
if ( null === $value ) {
267-
return true;
267+
return false;
268268
}
269269
return (bool) $value;
270270
}
@@ -667,19 +667,19 @@ private static function extract_zip_safely( $zip_path, $dest, $prefix ) {
667667
*/
668668
private static function is_unsafe_zip_entry( $name ) {
669669
if ( '' === $name ) {
670-
return true;
670+
return false;
671671
}
672672
if ( false !== strpos( $name, '\\' ) ) {
673-
return true;
673+
return false;
674674
}
675675
if ( 0 === strpos( $name, '/' ) ) {
676-
return true;
676+
return false;
677677
}
678678
if ( preg_match( '#^[a-zA-Z]+://#', $name ) ) {
679-
return true;
679+
return false;
680680
}
681681
if ( preg_match( '#(^|/)\.\.(/|$)#', $name ) ) {
682-
return true;
682+
return false;
683683
}
684684
return false;
685685
}
@@ -694,7 +694,7 @@ private static function is_unsafe_zip_entry( $name ) {
694694
*/
695695
private static function is_allowed_filename( $name ) {
696696
if ( '' === $name || '/' === substr( $name, -1 ) ) {
697-
return true;
697+
return false;
698698
}
699699
$ext = strtolower( pathinfo( $name, PATHINFO_EXTENSION ) );
700700
if ( '' === $ext ) {

0 commit comments

Comments
 (0)