Title: [Plugin: Improved Simpler CSS] can crash php running under apache on windows
Last modified: August 20, 2016

---

# [Plugin: Improved Simpler CSS] can crash php running under apache on windows

 *  [James Revillini](https://wordpress.org/support/users/jrevillini/)
 * (@jrevillini)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-improved-simpler-css-can-crash-php-running-under-apache-on-windows/)
 * There is a bug in PHP that is plaguing many developers and site owners right 
   now which pertains to processing a ‘large’ string with preg_replace. Something
   to do with the apache stack.
 * Long story short: this line (improved-simpler-css.php:251) brings my site down
   `
   $_return = preg_replace ( '/@import.+;( |)|((?:\/\*(?:[^*]|(?:\*+[^*\/]))*\*+\/))/
   i', '', $_content );`
 * if I replace with `$_return = $_content` everything is fine. I’m OK with the 
   extra load time for now. I’m probably going to try splitting the replace statement
   into multiple steps.
 * more info/examples: [http://www.apachefriends.org/f/viewtopic.php?f=16&t=45367#p184056](http://www.apachefriends.org/f/viewtopic.php?f=16&t=45367#p184056)
 * [http://wordpress.org/extend/plugins/imporved-simpler-css/](http://wordpress.org/extend/plugins/imporved-simpler-css/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [James Revillini](https://wordpress.org/support/users/jrevillini/)
 * (@jrevillini)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-improved-simpler-css-can-crash-php-running-under-apache-on-windows/#post-2312075)
 * This replacement function seems to work under XAMPP for windows. It doesn’t do
   as much optimizing but I don’t think it screws up anything.
 *     ```
       function improved_simpler_css_filter($_content) {
       	$_return = $_content;
       	$_return = preg_replace ( '/@import.+;/i', '', $_return ); // rem import stmts
       	$_return = preg_replace ( '/(\t|\n)/', '', $_return ); // rem tabs & linebreaks
       	$_return = preg_replace ( '#/\*.+?\*/#s', '', $_return ); // rem comments
       	$_return = htmlspecialchars ( strip_tags($_return), ENT_NOQUOTES, 'UTF-8' );
       	return $_return;
       }
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘[Plugin: Improved Simpler CSS] can crash php running under apache on 
windows’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/imporved-simpler-css_ebebeb.svg)
 * [Improved Simpler CSS](https://wordpress.org/plugins/imporved-simpler-css/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/imporved-simpler-css/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/imporved-simpler-css/)
 * [Active Topics](https://wordpress.org/support/plugin/imporved-simpler-css/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/imporved-simpler-css/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/imporved-simpler-css/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [James Revillini](https://wordpress.org/support/users/jrevillini/)
 * Last activity: [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-improved-simpler-css-can-crash-php-running-under-apache-on-windows/#post-2312075)
 * Status: not resolved