mirror of
https://github.com/maxpozdeev/mytinytodo.git
synced 2026-03-11 08:55:27 +00:00
- fix error if script title was saved in settings in non-utf8 encoding
This commit is contained in:
parent
dd5e4f63ce
commit
4e083c6327
2 changed files with 10 additions and 1 deletions
|
|
@ -29,7 +29,7 @@
|
|||
$().ready(function(){
|
||||
mytinytodo.init({
|
||||
token: "<?php echo htmlspecialchars(access_token()); ?>" ,
|
||||
title: <?php echo json_encode(get_unsafe_mttinfo('title'), JSON_UNESCAPED_UNICODE); ?> ,
|
||||
title: <?php echo mtt_quoted_title() ?> ,
|
||||
lang: <?php echo Lang::instance()->makeJS() ?>,
|
||||
mttUrl: "<?php mttinfo('mtt_url'); ?>",
|
||||
homeUrl: "<?php mttinfo('url'); ?>",
|
||||
|
|
|
|||
|
|
@ -250,6 +250,15 @@ function reset_mttinfo($key)
|
|||
unset( $_mttinfo[$key] );
|
||||
}
|
||||
|
||||
function mtt_quoted_title()
|
||||
{
|
||||
$s = json_encode(get_unsafe_mttinfo('title'), JSON_UNESCAPED_UNICODE);
|
||||
if ($s === false) {
|
||||
return '""';
|
||||
}
|
||||
return $s;
|
||||
}
|
||||
|
||||
function getRequestUri()
|
||||
{
|
||||
// Do not use HTTP_X_REWRITE_URL due to CVE-2018-14773
|
||||
|
|
|
|||
Loading…
Reference in a new issue