Skip to content

Commit 92ff28e

Browse files
author
Thai Wood
committed
Escape each time instead of redefining it
1 parent cea076e commit 92ff28e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

inline-gdocs-viewer.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -592,8 +592,7 @@ private function dataToHtml ($r, $options, $caption = '') {
592592
$id = ( 0 === $this->invocations )
593593
? 'igsv-' . $this->getDocId( $options['key'] )
594594
: "igsv-{$this->invocations}-" . $this->getDocId( $options['key'] );
595-
$id = esc_attr( $id );
596-
$html = '<table id="$id"';
595+
$html = '<table id="' . esc_attr( $id ) . '"';
597596
// Prepend a space character onto the 'class' value, if one exists.
598597
if ( ! empty( $options['class'] ) ) {
599598
$options['class'] = " {$options['class']}";
@@ -614,7 +613,7 @@ private function dataToHtml ($r, $options, $caption = '') {
614613

615614
$html .= "<thead>\n";
616615
foreach ( $thead as $v ) {
617-
$html .= "<tr id=\"$id-row-$ir\" class=\"row-$ir " . $this->evenOrOdd( $ir ) . "\">";
616+
$html .= "<tr id=\"" . esc_attr( $id ) . '-row-$ir" class="row-$ir ' . $this->evenOrOdd( $ir ) . "\">";
618617
$ir++;
619618
$ic = 1; // reset column counting
620619
foreach ( $v as $th ) {
@@ -629,7 +628,7 @@ private function dataToHtml ($r, $options, $caption = '') {
629628
if ( $tfoot ) {
630629
$html .= "<tfoot>\n";
631630
foreach ( $tfoot as $v ) {
632-
$html .= "<tr id=\"$id-row-$ir\" class=\"row-$ir " . $this->evenOrOdd( $ir ) . "\">";
631+
$html .= "<tr id=\"" . esc_attr( $id ) . "-row-$ir\" class=\"row-$ir " . $this->evenOrOdd( $ir ) . "\">";
633632
$ir++;
634633
$ic = 1; // reset column counting
635634
foreach ( $v as $td ) {
@@ -645,7 +644,7 @@ private function dataToHtml ($r, $options, $caption = '') {
645644

646645
$html .= "<tbody>\n";
647646
foreach ( $tbody as $v ) {
648-
$html .= "<tr id=\"$id-row-$ir\" class=\"row-$ir " . $this->evenOrOdd( $ir ) . "\">";
647+
$html .= "<tr id=\"" . esc_attr( $id ) . "-row-$ir\" class=\"row-$ir " . $this->evenOrOdd( $ir ) . "\">";
649648
$ir++;
650649
$ic = 1; // reset column counting
651650
foreach ( $v as $td ) {

0 commit comments

Comments
 (0)