• My site has been unable to display due to an error since I updated to 2.3.

    Now it works fine in 2.3

    In my case the cause was

    
    function wp_scss_set_variables(){
            $variables = array(
    			'colors' => ' primary #333, secondary #666',
            );
            return $variables;
    
    }
    add_filter('wp_scss_variables','wp_scss_set_variables');
    

    It seems that a fatal error occurs when there is a space at the beginning of the colors value

    Thank you.

    • This topic was modified 3 years, 5 months ago by nobita.
Viewing 1 replies (of 1 total)
  • Plugin Author Sky Bolt

    (@sky-bolt)

    That’s an interesting bug that would probably end up being traced back to the SCSS compiler.
    The WP-SCSS plugin does check for empty values:

    $variables = apply_filters('wp_scss_variables', array());
      foreach ($variables as $variable_key => $variable_value) {
        if (strlen(trim($variable_value)) == 0) {
          unset($variables[$variable_key]);
        }
      }
      $wpscss_compiler->set_variables($variables);
    

    It might be worth changing it to trim the value:

    
    $variables = apply_filters('wp_scss_variables', array());
      foreach ($variables as $variable_key => $variable_value) {
        if (strlen(trim($variable_value)) == 0) {
          unset($variables[$variable_key]);
        }
        $variables[$variable_key] = trim($variable_value);
      }
      $wpscss_compiler->set_variables($variables);
    

    My concern is that this is allowing variables that are not well-formatted to be set.

    • This reply was modified 3 years, 2 months ago by Sky Bolt.
    • This reply was modified 3 years, 2 months ago by Sky Bolt.
    • This reply was modified 3 years, 2 months ago by Sky Bolt.
Viewing 1 replies (of 1 total)
  • The topic ‘ver 2.3 Why in my case the site was broken due to a fatal error’ is closed to new replies.