You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The editor returns a false syntax error when a certain case statement is used with a switch statement. "Syntax error, unexpected T_STRING, expecting T_CASE or T_DEFAULT or '}'"
Example:
<?phpsession_start();
ini_set('display_errors', -1);
if(!isset($_SESSION['secure_token'], $_POST['action'], $_POST['token']))
die(json_encode(array("error" => "missing vars")));
require("functions.php");
if($_POST['token'] != $_SESSION['secure_token']) {
add_error("CSRF", $_SERVER['SCRIPT_NAME']);
$_SESSION['secure_token'] = create_secure_token();
die(json_encode(array("error" => "invalid session")));
}
switch($_POST['action']) {
// Syntax error occurs on the line below - it is valid syntax normally used for comparisonscase("open_editor"):
// rest of code irrelevant
}
?>
The text was updated successfully, but these errors were encountered:
The editor returns a false syntax error when a certain case statement is used with a switch statement. "Syntax error, unexpected T_STRING, expecting T_CASE or T_DEFAULT or '}'"
Example:
The text was updated successfully, but these errors were encountered: