PluginProbe
Patchstack – WordPress & Plugins Security / 2.3.6
Patchstack – WordPress & Plugins Security v2.3.6
2.3.7 trunk 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.16 2.1.17 2.1.18 2.1.19 2.1.2 2.1.20 2.1.21 2.1.22 2.1.23 2.1.24 2.1.25 2.1.3 2.1.4 2.1.5 2.1.6 All 49 releases
← All changes | includes/htaccess.php +2 -10 trunk2.3.6 View file →
@@ -120,9 +120,9 @@
120 120 }
121 121
122 122 // Get the current rules.
123 123 $current = $old = $fs->get_contents( ABSPATH . '.htaccess' );
124 - $current = $this->delete_all_between( '# Patchstack Firewall Start', '# Patchstack Firewall End', $current );
124 + $current = $this->delete_all_between( '# Patchstack Firewall Start', "# Patchstack Firewall End\r\n", $current );
125 125
126 126 // If no rules, then we delete the old ones.
127 127 if ( $rules != '' ) {
128 128 $current = "# Patchstack Firewall Start\r\n<IfModule mod_rewrite.c>\r\nRewriteEngine On\r\n" . $rules . "\r\n</IfModule>\r\n# Patchstack Firewall End\r\n" . $current;
@@ -345,16 +345,8 @@
345 345 if ( $begin_pos === false || $end_pos === false ) {
346 346 return $string;
347 347 }
348 348
349 - $end_pos += strlen( $end );
350 -
351 - // Consume any trailing newline characters so the block is removed cleanly
352 - // regardless of CRLF/LF line endings and repeated writes don't stack blank lines.
353 - while ( isset( $string[ $end_pos ] ) && ( $string[ $end_pos ] === "\r" || $string[ $end_pos ] === "\n" ) ) {
354 - $end_pos++;
355 - }
356 -
357 - $delete = substr( $string, $begin_pos, $end_pos - $begin_pos );
349 + $delete = substr( $string, $begin_pos, ( $end_pos + strlen( $end ) ) - $begin_pos );
358 350 return str_replace( $delete, '', $string );
359 351 }
360 352 }