| | $CMD = "timeout 5 $JAVA_HOME/bin/java $JAVA_OPTS -jar $KEENQUOTES"; |
| | |
| | +$source = ""; |
| | + |
| | if( $_SERVER[ 'REQUEST_METHOD' ] == 'POST' ) { |
| | - $source = $_POST[ 'source' ]; |
| | + $source = isset( $_POST[ 'source' ] ) ? $_POST[ 'source' ] : ""; |
| | } |
| | ?> |
 |
| | |
| | input[type="text"], textarea { |
| | - background-color: #44464C; |
| | + background-color: #44464C; |
| | color: #fff; |
| | } |
 |
| | <textarea id="source" name="source" rows="5" cols="60" autofocus><?php |
| | if( !empty( $source ) ) { |
| | - echo $source; |
| | + echo htmlspecialchars( $source, ENT_QUOTES, 'UTF-8' ); |
| | } |
| | ?></textarea> |
 |
| | <?php |
| | } |
| | -else { |
| | +elseif( !empty( $source ) ) { |
| | /* stdin, stdout, stderr */ |
| | - $descriptors = array( |
| | + $descriptors = array( |
| | 0 => array( "pipe", "r" ), |
| | 1 => array( "pipe", "w" ), |
 |
| | } |
| | else { |
| | - echo "<p id='output' class='output'>$stdout</p>"; |
| | + echo "<p id='output' class='output'>" . |
| | + htmlspecialchars( $stdout, ENT_QUOTES, 'UTF-8' ) . "</p>"; |
| | } |
| | } |
 |
| | var textarea = document.createElement( "textarea" ); |
| | textarea.value = text; |
| | - |
| | + |
| | textarea.style.top = "0"; |
| | textarea.style.left = "0"; |