| | |
| | | |
| | | /** |
| | | * Replace all css definitions with #container [def] |
| | | * and remove css-inlined scripting |
| | | * |
| | | * @param string CSS source code |
| | | * @param string Container ID to use as prefix |
| | |
| | | { |
| | | $a_css_values = array(); |
| | | $last_pos = 0; |
| | | |
| | | // ignore the whole block if evil styles are detected |
| | | if (stristr($source, 'expression') || stristr($source, 'behavior')) |
| | | return ''; |
| | | |
| | | // cut out all contents between { and } |
| | | while (($pos = strpos($source, '{', $last_pos)) && ($pos2 = strpos($source, '}', $pos))) |
| | |
| | | $last_pos = $pos+2; |
| | | } |
| | | |
| | | // remove html commends and add #container to each tag selector. |
| | | // remove html comments and add #container to each tag selector. |
| | | // also replace body definition because we also stripped off the <body> tag |
| | | $styles = preg_replace( |
| | | array( |