Skip to content

Commit

Permalink
Fix SetClipboardText for web (#3257)
Browse files Browse the repository at this point in the history
  • Loading branch information
ubkp authored Aug 26, 2023
1 parent 8f22862 commit 4fa66f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rcore.c
Original file line number Diff line number Diff line change
Expand Up @@ -2150,7 +2150,7 @@ void SetClipboardText(const char *text)
#if defined(PLATFORM_WEB)
// Security check to (partially) avoid malicious code
if (strchr(text, '\'') != NULL) TRACELOG(LOG_WARNING, "SYSTEM: Provided Clipboard could be potentially malicious, avoid [\'] character");
else emscripten_run_script(TextFormat("navigator.clipboard.writeText('%s')", text));
else EM_ASM( { navigator.clipboard.writeText(UTF8ToString($0)); }, text);
#endif
}

Expand Down

0 comments on commit 4fa66f2

Please sign in to comment.