diff --git a/js/account.js b/js/account.js index 0b1da3f..8647358 100644 --- a/js/account.js +++ b/js/account.js @@ -118,13 +118,13 @@ function renderOrders() { c => c.id === order.course_id ); orderName = course ? course.name : - `Курс #${order.course_id}`; + `Курс #${esc(order.course_id)}`; } else if (order.tutor_id && order.tutor_id > 0) { const tutor = AccountState.tutors.find( t => t.id === order.tutor_id ); orderName = tutor ? `Репетитор: ${tutor.name}` : - `Репетитор #${order.tutor_id}`; + `Репетитор #${esc(order.tutor_id)}`; } const orderDate = formatDateTimeWithoutSeconds( @@ -133,22 +133,22 @@ function renderOrders() { ); tr.innerHTML = ` - ${orderNumber} - ${orderName} - ${orderDate} + ${esc(orderNumber)} + ${esc(orderName)} + ${esc(orderDate)} ${formatPrice(order.price)}
@@ -254,7 +254,7 @@ function viewOrderDetails(orderId) { if (course) { orderTitle = course.name; teacherInfo = `

Преподаватель: - ${course.teacher}

`; + ${esc(course.teacher)}

`; } } else if (order.tutor_id && order.tutor_id > 0) { const tutor = AccountState.tutors.find( @@ -284,7 +284,7 @@ function viewOrderDetails(orderId) { options.push('Доступ к интерактивной онлайн-платформе (+50%)'); const optionsBadges = options.map(opt => - `${opt}` + `${esc(opt)}` ).join(''); const contactData = ContactDataStorage.get(order.id); @@ -294,16 +294,16 @@ function viewOrderDetails(orderId) { contactInfo = `
Контактные данные:
-

Имя: ${contactData.name}

-

Телефон: ${contactData.phone}

-

Email: ${contactData.email}

+

Имя: ${esc(contactData.name)}

+

Телефон: ${esc(contactData.phone)}

+

Email: ${esc(contactData.email)}

${contactData.message ? `

Сообщение: ${contactData.message}

` : ''} `; } - let detailsHTML = `
${orderTitle}
${teacherInfo}`; + let detailsHTML = `
${esc(orderTitle)}
${teacherInfo}`; let priceLabel = ''; if (order.course_id && order.course_id > 0) { @@ -312,9 +312,9 @@ function viewOrderDetails(orderId) { ${formatDate(order.date_start)}

Время: ${formatTime(order.time_start)}

Продолжительность: - ${order.duration} часов

+ ${esc(order.duration)} часов

Количество студентов: - ${order.persons}

+ ${esc(order.persons)}

${options.length > 0 ? `

Выбранные опции:
${optionsBadges}

` : ''} @@ -328,9 +328,9 @@ function viewOrderDetails(orderId) { } detailsHTML += ` - ${contactInfo} + ${esc(contactInfo)}
-
${priceLabel}
+
${esc(priceLabel)}
`; content.innerHTML = detailsHTML; diff --git a/js/app.js b/js/app.js index a7d5472..a948f64 100644 --- a/js/app.js +++ b/js/app.js @@ -163,7 +163,7 @@ function renderCourses() { item.innerHTML = `
-
${course.name}
+
${esc(course.name)}
${getLevelText(course.level)} @@ -175,12 +175,12 @@ function renderCourses() {
- ${course.teacher} + ${esc(course.teacher)}
- ${course.total_length} недель, - ${course.week_length} ч/нед + ${esc(course.total_length)} недель, + ${esc(course.week_length)} ч/нед
@@ -582,13 +582,13 @@ function renderTutors() {
- ${tutor.name} + ${esc(tutor.name)} ${getLevelText(tutor.language_level)} ${tutor.languages_offered.join(', ')} - ${tutor.work_experience} лет + ${esc(tutor.work_experience)} лет ${formatPrice(tutor.price_per_hour)}/час `;