Skip to content

Commit 8ca832e

Browse files
committed
Use use so closure has access to variable from parent scope
1 parent 1024346 commit 8ca832e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/runner.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ function fix_newlines( $text ) {
155155
// Replace newline characters within 'code' and 'pre' tags with replacement string.
156156
$text = preg_replace_callback(
157157
"/(?<=<pre><code>)(.+)(?=<\/code><\/pre>)/s",
158-
function ( $matches ) {
158+
function ( $matches ) use ( $replacement_string ) {
159159
return preg_replace( '/[\n\r]/', $replacement_string, $matches[1] );
160160
},
161161
$text

0 commit comments

Comments
 (0)