summaryrefslogtreecommitdiff
path: root/lib/exe/js.php
diff options
context:
space:
mode:
authorGerrit Uitslag <klapinklapin@gmail.com>2013-10-10 15:53:03 +0200
committerGerrit Uitslag <klapinklapin@gmail.com>2013-10-10 15:53:03 +0200
commitdf5d307ea8bac1f5030d42af363ae9f7469a63f2 (patch)
tree13dccf2f697b039ec10afac084e9ee212b844b23 /lib/exe/js.php
parent75e4dd8a2ec6c181e99877919b5a2b529407752a (diff)
downloadrpg-df5d307ea8bac1f5030d42af363ae9f7469a63f2.tar.gz
rpg-df5d307ea8bac1f5030d42af363ae9f7469a63f2.tar.bz2
add cookie secure parameter to cookies set by javascript
Diffstat (limited to 'lib/exe/js.php')
-rw-r--r--lib/exe/js.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/exe/js.php b/lib/exe/js.php
index fc7a869c2..040b8874d 100644
--- a/lib/exe/js.php
+++ b/lib/exe/js.php
@@ -86,16 +86,20 @@ function js_out(){
// start output buffering and build the script
ob_start();
+ $json = new JSON();
// add some global variables
print "var DOKU_BASE = '".DOKU_BASE."';";
print "var DOKU_TPL = '".tpl_basedir()."';";
- print "var DOKU_COOKIEPATH = '" . (empty($conf['cookiedir']) ? DOKU_REL : $conf['cookiedir']) . "';";
+ print "var DOKU_COOKIE_PARAM = " . $json->encode(
+ array(
+ 'path' => empty($conf['cookiedir']) ? DOKU_REL : $conf['cookiedir'],
+ 'secure' => $conf['securecookie'] && is_ssl()
+ )).";";
// FIXME: Move those to JSINFO
print "var DOKU_UHN = ".((int) useHeading('navigation')).";";
print "var DOKU_UHC = ".((int) useHeading('content')).";";
// load JS specific translations
- $json = new JSON();
$lang['js']['plugins'] = js_pluginstrings();
$templatestrings = js_templatestrings();
if(!empty($templatestrings)) {