testing-20250128 #7

Closed
Ghost wants to merge 13 commits from (deleted):testing-20250128 into main
2 changed files with 11 additions and 2 deletions
Showing only changes of commit da783c43ba - Show all commits

View File

@ -1394,10 +1394,18 @@ const handleInviteMinter = async (minterName) => {
}
}
function escapeForHtmlAttribute(str) {
return str
.replace(/'/g, ''')
.replace(/"/g, '"');
}
const createInviteButtonHtml = (creator, cardIdentifier) => {
// Safely escape special chars so they won't break the HTML attribute
const safeCreator = escapeForHtmlAttribute(creator);
return `
<div id="invite-button-container-${cardIdentifier}" style="margin-top: 1em;">
<button onclick="handleInviteMinter('${creator}')"
<button onclick="handleInviteMinter('${safeCreator}')"
style="padding: 10px; background:rgb(0, 109, 76) ; color: white; border: dotted; border-color: white; cursor: pointer; border-radius: 5px;"
onmouseover="this.style.backgroundColor='rgb(25, 47, 39) '"
onmouseout="this.style.backgroundColor='rgba(7, 122, 101, 0.63) '"

View File

@ -331,7 +331,8 @@ const getNameInfo = async (name) => {
console.log('getNameInfo called')
console.log('name:', name)
try {
const response = await fetch(`${baseUrl}/names/${name}`)
// Encode the name for URL safety
const response = await fetch(`${baseUrl}/names/${encodeURIComponent(name)}`)
if (!response.ok) {
console.warn(`Failed to fetch name info for: ${name}, status: ${response.status}`)