fix: Strip shebang and <?php tag for PHP examples
The API runs PHP with -r flag which expects raw code without opening tags. Strip #!/usr/bin/env php and <?php from PHP files before sending to API.
This commit is contained in:
parent
a45f333b33
commit
d0eca0cb7e
1 changed files with 5 additions and 0 deletions
|
|
@ -243,6 +243,11 @@ validate_example() {
|
|||
return 1
|
||||
fi
|
||||
|
||||
# Strip shebang and PHP opening tag for PHP files (API uses -r flag)
|
||||
if [[ "$language" == "php" ]]; then
|
||||
code=$(echo "$code" | sed '1{/^#!/d}' | sed '1{/^<?php/d}')
|
||||
fi
|
||||
|
||||
# Measure execution time
|
||||
start_time=$(date +%s%N)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue