Fix some non-utf8-friendly htmlentities (resulting in wrong display of utf8-encoded directory names for example)

This commit is contained in:
Vitaly Kuznetsov 2012-05-10 09:10:53 +00:00
parent a9d7c67bf2
commit 6f981738bb
4 changed files with 5 additions and 5 deletions

View File

@ -7,7 +7,7 @@
* See the COPYING-README file. * See the COPYING-README file.
*/ */
?> ?>
<input type="hidden" id="bookmarkFilterTag" value="<?php if(isset($_GET['tag'])) echo htmlentities($_GET['tag']); ?>" /> <input type="hidden" id="bookmarkFilterTag" value="<?php if(isset($_GET['tag'])) echo htmlentities($_GET['tag'],ENT_COMPAT | ENT_HTML401,'utf-8'); ?>" />
<div id="controls"> <div id="controls">
<input type="hidden" id="bookmark_add_id" value="0" /> <input type="hidden" id="bookmark_add_id" value="0" />
<input type="text" id="bookmark_add_url" placeholder="<?php echo $l->t('Address'); ?>" class="bookmarks_input" /> <input type="text" id="bookmark_add_url" placeholder="<?php echo $l->t('Address'); ?>" class="bookmarks_input" />

View File

@ -15,7 +15,7 @@
<form data-upload-id='1' class="file_upload_form" action="<?php echo OCP\Util::linkTo('files', 'ajax/upload.php'); ?>" method="post" enctype="multipart/form-data" target="file_upload_target_1"> <form data-upload-id='1' class="file_upload_form" action="<?php echo OCP\Util::linkTo('files', 'ajax/upload.php'); ?>" method="post" enctype="multipart/form-data" target="file_upload_target_1">
<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $_['uploadMaxFilesize'] ?>" id="max_upload"> <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $_['uploadMaxFilesize'] ?>" id="max_upload">
<input type="hidden" class="max_human_file_size" value="(max <?php echo $_['uploadMaxHumanFilesize']; ?>)"> <input type="hidden" class="max_human_file_size" value="(max <?php echo $_['uploadMaxHumanFilesize']; ?>)">
<input type="hidden" name="dir" value="<?php echo htmlentities($_['dir']) ?>" id="dir"> <input type="hidden" name="dir" value="<?php echo htmlentities($_['dir'],ENT_COMPAT | ENT_HTML401,'utf-8') ?>" id="dir">
<button class="file_upload_filename">&nbsp;<img class='svg action' alt="Upload" src="<?php echo OCP\image_path("core", "actions/upload.svg"); ?>" /></button> <button class="file_upload_filename">&nbsp;<img class='svg action' alt="Upload" src="<?php echo OCP\image_path("core", "actions/upload.svg"); ?>" /></button>
<input class="file_upload_start" type="file" name='files[]'/> <input class="file_upload_start" type="file" name='files[]'/>
<a href="#" class="file_upload_button_wrapper" onclick="return false;" title="<?php echo $l->t('Upload'); echo ' max. '.$_['uploadMaxHumanFilesize'] ?>"></a> <a href="#" class="file_upload_button_wrapper" onclick="return false;" title="<?php echo $l->t('Upload'); echo ' max. '.$_['uploadMaxHumanFilesize'] ?>"></a>

View File

@ -1,6 +1,6 @@
<?php for($i=0; $i<count($_["breadcrumb"]); $i++): <?php for($i=0; $i<count($_["breadcrumb"]); $i++):
$crumb = $_["breadcrumb"][$i]; ?> $crumb = $_["breadcrumb"][$i]; ?>
<div class="crumb <?php if($i == count($_["breadcrumb"])-1) echo 'last';?> svg" data-dir='<?php echo $crumb["dir"];?>' style='background-image:url("<?php echo OCP\image_path('core','breadcrumb.png');?>")'> <div class="crumb <?php if($i == count($_["breadcrumb"])-1) echo 'last';?> svg" data-dir='<?php echo $crumb["dir"];?>' style='background-image:url("<?php echo OCP\image_path('core','breadcrumb.png');?>")'>
<a href="<?php echo $_['baseURL'].$crumb["dir"]; ?>"><?php echo htmlentities($crumb["name"]); ?></a> <a href="<?php echo $_['baseURL'].$crumb["dir"]; ?>"><?php echo htmlentities($crumb["name"],ENT_COMPAT | ENT_HTML401,'utf-8'); ?></a>
</div> </div>
<?php endfor;?> <?php endfor;?>

View File

@ -7,7 +7,7 @@
<?php endif; ?> <?php endif; ?>
<p class="infield"> <p class="infield">
<label for="user" class="infield"><?php echo $l->t( 'Username' ); ?></label> <label for="user" class="infield"><?php echo $l->t( 'Username' ); ?></label>
<input type="text" name="user" id="user" value="<?php echo !empty($_POST['user'])?htmlentities($_POST['user']).'"':'" autofocus'; ?> autocomplete="off" required /> <input type="text" name="user" id="user" value="<?php echo !empty($_POST['user'])?htmlentities($_POST['user'],ENT_COMPAT | ENT_HTML401,'utf-8').'"':'" autofocus'; ?> autocomplete="off" required />
</p> </p>
<p class="infield"> <p class="infield">
<label for="password" class="infield"><?php echo $l->t( 'Password' ); ?></label> <label for="password" class="infield"><?php echo $l->t( 'Password' ); ?></label>