r76171 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76170‎ | r76171 | r76172 >
Date:23:57, 5 November 2010
Author:tparscal
Status:deferred
Tags:
Comment:
Added string casting to support use of __toString()
Modified paths:
  • /trunk/extensions/HtmlUi/classes/HtmlUiTemplate.php (modified) (history)

Diff [purge]

Index: trunk/extensions/HtmlUi/classes/HtmlUiTemplate.php
@@ -60,7 +60,7 @@
6161 }
6262 return $data;
6363 }
64 - return htmlspecialchars( $data );
 64+ return htmlspecialchars( (string) $data );
6565 }
6666
6767 /**
@@ -76,7 +76,7 @@
7777 }
7878 return $data;
7979 }
80 - return htmlspecialchars_decode( $data );
 80+ return htmlspecialchars_decode( (string) $data );
8181 }
8282
8383 /**
@@ -97,18 +97,18 @@
9898 foreach ( $data as $key => $value ) {
9999 if ( is_array( $value ) ) {
100100 // Named list of attributes
101 - $result[] = htmlspecialchars( $key ) . '="' . implode( ' ', $value ) . '"';
 101+ $result[] = self::escpae( $key ) . '="' . implode( ' ', (string) $value ) . '"';
102102 } else if ( is_string( $key ) ) {
103103 // Named attribute
104 - $result[] = htmlspecialchars( $key ) . '="' . $value . '"';
 104+ $result[] = self::escpae( $key ) . '="' . $value . '"';
105105 } else {
106106 // Value-less attribute such as "checked"
107 - $result[] = $value;
 107+ $result[] = (string) $value;
108108 }
109109 }
110110 } else {
111111 // Value-less attribute such as "checked"
112 - $result[] = $value;
 112+ $result[] = (string) $value;
113113 }
114114 return count( $result ) ? ( ' ' . implode( ' ', $result ) ) : '';
115115 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r76172Merging r76029 through r76171 of trunk - includes merge to trunk from OWA branchawjrichards00:00, 6 November 2010

Status & tagging log