Skip to content

Commit

Permalink
Fix SetClipboardText for web
Browse files Browse the repository at this point in the history
  • Loading branch information
ubkp committed Aug 21, 2023
1 parent 5ed83df commit c7c5213
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 c7c5213

Please sign in to comment.