20
20
21
21
echo $ this ->doctype ().PHP_EOL ;
22
22
?>
23
- <html lang="<?php echo $ this ->lang ; ?> " xml:lang="<?php echo $ this ->lang ; ?> " xmlns="http://www.w3.org/1999/xhtml">
23
+ <html lang="<?php echo $ this ->escape ( $ this -> lang ) ; ?> " xml:lang="<?php echo $ this ->escape ( $ this -> lang ) ; ?> " xmlns="http://www.w3.org/1999/xhtml">
24
24
<head>
25
25
<?php
26
26
$ this ->headMeta ()->appendHttpEquiv ('Content-Type ' , 'text/html; charset=UTF-8 ' );
27
- $ this ->headMeta ()->appendName ('description ' , htmlspecialchars ($ this ->metaDescription , ENT_QUOTES , ' UTF-8 ' ));
27
+ $ this ->headMeta ()->appendName ('description ' , $ this -> escape ($ this ->metaDescription ));
28
28
echo $ this ->headMeta ().PHP_EOL ;
29
29
30
- $ this ->headTitle (htmlspecialchars ($ this ->title , ENT_QUOTES , ' UTF-8 ' ));
30
+ $ this ->headTitle ($ this -> escape ($ this ->title ));
31
31
$ this ->headTitle ()->setSeparator (' - ' );
32
32
echo $ this ->headTitle ().PHP_EOL ;
33
33
@@ -113,17 +113,17 @@ echo $this->doctype().PHP_EOL;
113
113
<?php
114
114
if ($ this ->logged && isset ($ this ->userDao )) {
115
115
echo '
116
- <b><a id="topUserName" href=" ' .$ this ->webroot .'/user/ ' .$ this ->userDao ->getUserId (
117
- ).'"> ' .$ this ->userDao ->getFullName ().' <img class="arrowUser" src=" ' .$ this ->baseUrl (
116
+ <b><a id="topUserName" href=" ' .$ this ->webroot .'/user/ ' .$ this ->escape ( $ this -> userDao ->getUserId (
117
+ )) .'"> ' .$ this ->escape ( $ this -> userDao ->getFullName () ).' <img class="arrowUser" src=" ' .$ this ->baseUrl (
118
118
'core/public/images/icons/arrow-user.gif '
119
119
).'" alt ="" /> </a> </b>
120
120
<ul>
121
121
<li onclick="window.location = \'' .$ this ->webroot .'/user/userpage \';"><a> ' .$ this ->t (
122
122
'My Page '
123
123
).'</a></li>
124
124
<li class="myAccountLink"><a href=" ' .$ this ->baseUrl (
125
- 'user/settings?userId= ' .$ this ->userDao ->getKey ()
126
- ).'"> ' .$ this ->t ('My Account ' ).'</a></li>
125
+ 'user/settings?userId= ' .$ this ->escape ( $ this -> userDao ->getKey ()
126
+ )) .'"> ' .$ this ->t ('My Account ' ).'</a></li>
127
127
' ;
128
128
if ($ this ->userDao ->isAdmin ()) {
129
129
echo '
@@ -140,7 +140,7 @@ echo $this->doctype().PHP_EOL;
140
140
foreach ($ linksModules as $ links ) {
141
141
foreach ($ links as $ name => $ link ) {
142
142
echo '
143
- <li onclick="window.location = \'' .$ link .'\';"><a> ' .$ name .'</a></li> ' ;
143
+ <li onclick="window.location = \'' .$ this -> escape ( $ link) .'\';"><a> ' .$ this -> escape ( $ name) .'</a></li> ' ;
144
144
}
145
145
}
146
146
}
@@ -225,7 +225,7 @@ echo $this->doctype().PHP_EOL;
225
225
<ul>
226
226
<li class="uploadFile" title="Upload"
227
227
rel="<?php echo $ this ->baseUrl ('upload/simpleupload ' ); ?> <?php if (isset ($ this ->mainFolder )) {
228
- echo '/?parent= ' .$ this ->mainFolder ->folder_id ;
228
+ echo '/?parent= ' .$ this ->escape ( $ this -> mainFolder ->folder_id ) ;
229
229
} ?> ">
230
230
<a href="#"><img id="uploadAFile"
231
231
src="<?php echo $ this ->baseUrl ('core/public/images/icons/addfile.png ' ); ?> "
@@ -302,13 +302,8 @@ echo $this->doctype().PHP_EOL;
302
302
$ link = $ array [0 ];
303
303
$ image = $ array [1 ];
304
304
?>
305
- <li onclick="window.location = '<?php echo $ link ; ?> ';">
306
- <a href="<?php echo $ link ; ?> "><img alt=""
307
- src="<?php echo $ image ; ?> "/><span> <?php echo htmlspecialchars (
308
- $ name ,
309
- ENT_QUOTES ,
310
- 'UTF-8 '
311
- ); ?> </span></a></li>
305
+ <li onclick="window.location = '<?php echo $ this ->escape ($ link ); ?> ';">
306
+ <a href="<?php echo $ this ->escape ($ link ); ?> "><img alt="" src="<?php echo $ this ->escape ($ image ); ?> "/><span> <?php echo $ this ->escape ($ name ); ?> </span></a></li>
312
307
<?php
313
308
}
314
309
}
@@ -323,12 +318,12 @@ echo $this->doctype().PHP_EOL;
323
318
echo '<ul> ' ;
324
319
foreach ($ recentReverse as $ item ) {
325
320
if (is_array ($ item )) {
326
- echo "<li onclick= \"window.location = ' {$ this ->webroot }/item/ {$ item ['item_id ' ]}'; \" class='recentItem' qtip=' " .str_replace (
321
+ echo "<li onclick= \"window.location = ' {$ this ->webroot }/item/ {$ this -> escape ( $ item ['item_id ' ]) }'; \" class='recentItem' qtip=' " .str_replace (
327
322
"' " ,
328
323
'" ' ,
329
- $ item ['name ' ]
330
- )."'><a href=' {$ this ->webroot }/item/ {$ item ['item_id ' ]}'> " .$ this ->slicename (
331
- $ item ['name ' ],
324
+ $ this -> escape ( $ item ['name ' ])
325
+ )."'><a href=' {$ this ->webroot }/item/ {$ this -> escape ( $ item ['item_id ' ]) }'> " .$ this ->slicename (
326
+ $ this -> escape ( $ item ['name ' ]) ,
332
327
20
333
328
)."</a></li> " ;
334
329
}
@@ -362,11 +357,7 @@ echo $this->doctype().PHP_EOL;
362
357
?>
363
358
</div>
364
359
<div class="Footer">
365
- <a href="http://www.midasplatform.org/">Midas Platform</a> <?php echo htmlspecialchars (
366
- $ this ->version ,
367
- ENT_QUOTES ,
368
- 'UTF-8 '
369
- ); ?> - © <?php echo date ('Y ' ); ?>
360
+ <a href="http://www.midasplatform.org/">Midas Platform</a> <?php echo $ this ->escape ($ this ->version ); ?> - © <?php echo date ('Y ' ); ?>
370
361
<a href="http://www.kitware.com">Kitware</a> -
371
362
<a href="https://github.com/midasplatform/Midas/issues"><?php echo $ this ->t ('Report bug ' ); ?> </a>
372
363
</div>
@@ -377,7 +368,7 @@ echo $this->doctype().PHP_EOL;
377
368
<input type="hidden" class="webroot" value="<?php echo $ this ->baseUrl (); ?> "/>
378
369
379
370
<div style="display: none;" class="jsonContent">
380
- <?php echo $ this ->json .PHP_EOL ; ?>
371
+ <?php echo $ this ->escape ( $ this -> json ) .PHP_EOL ; ?>
381
372
</div>
382
373
<div id="dialogStartingGuide" style="display:none;" title="<?php echo $ this ->t ('Starting Guide ' ); ?> ">
383
374
<br/>
0 commit comments