Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dokuwiki
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BRIC
dokuwiki
Commits
df5d307e
Commit
df5d307e
authored
11 years ago
by
Gerrit Uitslag
Browse files
Options
Downloads
Patches
Plain Diff
add cookie secure parameter to cookies set by javascript
parent
75e4dd8a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/exe/js.php
+6
-2
6 additions, 2 deletions
lib/exe/js.php
lib/scripts/cookie.js
+1
-1
1 addition, 1 deletion
lib/scripts/cookie.js
with
7 additions
and
3 deletions
lib/exe/js.php
+
6
−
2
View file @
df5d307e
...
@@ -86,16 +86,20 @@ function js_out(){
...
@@ -86,16 +86,20 @@ function js_out(){
// start output buffering and build the script
// start output buffering and build the script
ob_start
();
ob_start
();
$json
=
new
JSON
();
// add some global variables
// add some global variables
print
"var DOKU_BASE = '"
.
DOKU_BASE
.
"';"
;
print
"var DOKU_BASE = '"
.
DOKU_BASE
.
"';"
;
print
"var DOKU_TPL = '"
.
tpl_basedir
()
.
"';"
;
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
// FIXME: Move those to JSINFO
print
"var DOKU_UHN = "
.
((
int
)
useHeading
(
'navigation'
))
.
";"
;
print
"var DOKU_UHN = "
.
((
int
)
useHeading
(
'navigation'
))
.
";"
;
print
"var DOKU_UHC = "
.
((
int
)
useHeading
(
'content'
))
.
";"
;
print
"var DOKU_UHC = "
.
((
int
)
useHeading
(
'content'
))
.
";"
;
// load JS specific translations
// load JS specific translations
$json
=
new
JSON
();
$lang
[
'js'
][
'plugins'
]
=
js_pluginstrings
();
$lang
[
'js'
][
'plugins'
]
=
js_pluginstrings
();
$templatestrings
=
js_templatestrings
();
$templatestrings
=
js_templatestrings
();
if
(
!
empty
(
$templatestrings
))
{
if
(
!
empty
(
$templatestrings
))
{
...
...
This diff is collapsed.
Click to expand it.
lib/scripts/cookie.js
+
1
−
1
View file @
df5d307e
...
@@ -30,7 +30,7 @@ var DokuCookie = {
...
@@ -30,7 +30,7 @@ var DokuCookie = {
text
.
push
(
encodeURIComponent
(
key
)
+
'
#
'
+
encodeURIComponent
(
val
));
text
.
push
(
encodeURIComponent
(
key
)
+
'
#
'
+
encodeURIComponent
(
val
));
}
}
});
});
jQuery
.
cookie
(
this
.
name
,
text
.
join
(
'
#
'
),
{
expires
:
365
,
path
:
DOKU_COOKIEPA
TH
});
jQuery
.
cookie
(
this
.
name
,
text
.
join
(
'
#
'
),
{
expires
:
365
,
path
:
DOKU_COOKIE
_
PA
RAM
.
path
,
secure
:
DOKU_COOKIE_PARAM
.
secure
});
},
},
/**
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment