Skip to content

Commit afe3e4e

Browse files
fix c function call converter, prevent duplicate c code injection
1 parent 7cb0fc5 commit afe3e4e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/PHPtoCExt/Converter/CFuntionCallConverter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ public function convert()
6969
if (!isset($cSourceCodeMap[$cSourceFile])) {
7070
$cSourceCode = file_get_contents($this->inputDir."/".$cSourceFile);
7171
$cSourceCodeMap[$cSourceFile] = $cSourceCode;
72+
$withCSourceCode = "%{\n".$cSourceCodeMap[$cSourceFile]."\n}%\n".$originalCode;
73+
$this->postSearchAndReplace($originalCode, $withCSourceCode);
7274
}
73-
$withCSourceCode = "%{\n".$cSourceCodeMap[$cSourceFile]."\n}%\n".$originalCode;
74-
$this->postSearchAndReplace($originalCode, $withCSourceCode);
7575
}
7676

7777
}

0 commit comments

Comments
 (0)