$markerdata = explode( "\n", implode( '', file( $filename ) ) );
}
- $f = fopen( $filename, 'w' );
+ if ( !$f = @fopen( $filename, 'w' ) )
+ return false;
+
$foundit = false;
if ( $markerdata ) {
$state = true;
// Using win_is_writable() instead of is_writable() because of a bug in Windows PHP
if ( ( ! file_exists($web_config_file) && win_is_writable($home_path) && $wp_rewrite->using_mod_rewrite_permalinks() ) || win_is_writable($web_config_file) ) {
if ( iis7_supports_permalinks() ) {
- $rule = $wp_rewrite->iis7_url_rewrite_rules();
+ $rule = $wp_rewrite->iis7_url_rewrite_rules(false, '', '');
if ( ! empty($rule) ) {
return iis7_add_rewrite_rule($web_config_file, $rule);
} else {
if ( !is_string( $content ) || empty( $content ) )
return array();
+ if ( !function_exists('token_get_all') )
+ return array();
+
$tokens = token_get_all( $content );
$functions = array();
$ignore_functions = array();
$rule_fragment->appendXML($rewrite_rule);
$rules_node->appendChild($rule_fragment);
+ $doc->encoding = "UTF-8";
$doc->formatOutput = true;
saveDomDocument($doc, $filename);