Skip to content

Commit 10794fc

Browse files
committed
Script: Escape & sign in find to end cidReq search & replace syntax and avoid gobbing up larger course codes - refs BT#22302
1 parent 0f3d00c commit 10794fc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/scripts/replace_course_code.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ function replaceCodes(array $list): Generator
119119

120120
if (false === $previewMode && true === $updateFilesAndDirs) {
121121
exec('find '.$coursePath.$currentDirectory.'/document/ -type f -name "*.html" -exec sed -i '."'s#/courses/$currentDirectory/#/courses/$newDirectory/#g' {} +");
122-
exec('find '.$coursePath.$currentDirectory.'/document/ -type f -name "*.html" -exec sed -i '."'s#cidReq=$currentCode&#cidReq=$newCode&#g' {} +");
122+
exec('find '.$coursePath.$currentDirectory.'/document/ -type f -name "*.html" -exec sed -i '."'s#cidReq=$currentCode\&#cidReq=$newCode\&#g' {} +");
123123
} else {
124124
yield " File changes ignored (variable updateFilesAndDirs set to false)";
125125
}

0 commit comments

Comments
 (0)