Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Janis
/
btflags
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
9e5a5873
authored
2019-09-02 07:56:58 +0000
by
Janis
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch '17459_pci' into 'master'
17459_pci See merge request
!7
2 parents
b55e394c
1cd3a823
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
src/BTFlags/FlagManager.php
src/BTFlags/FlagManager.php
View file @
9e5a587
...
...
@@ -153,12 +153,26 @@ class FlagManager {
public
function
register
(){
$this
->
checkDir
();
$flags
=
$this
->
all
();
$cookies
=
array
(
'theme'
,
'cta'
,
'source'
,
'feedback'
,
'main_question'
);
if
(
!
$flags
)
return
[];
foreach
(
$flags
as
$flag
){
$value
=
$this
->
checkFlag
(
$flag
,
!
empty
(
$flag
[
'default'
])
?
$flag
[
'default'
]
:
null
);
if
(
in_array
(
$flag
[
'name'
],
$cookies
)){
if
(
isset
(
$_GET
[
$flag
[
'name'
]]))
{
setcookie
(
$flag
[
'name'
],
null
,
time
()
+
(
86400
*
30
),
"/"
);
setcookie
(
$flag
[
'encrypted_name'
],
$value
[
'cookie_value'
],
time
()
+
(
86400
*
30
),
"/"
);
}
}
else
{
setcookie
(
$flag
[
'name'
],
null
,
time
()
+
(
86400
*
30
),
"/"
);
setcookie
(
$flag
[
'encrypted_name'
],
$value
[
'cookie_value'
],
time
()
+
(
86400
*
30
),
"/"
);
}
}
}
private
function
filterFlag
(
$flag
,
$needle
,
$defaultValue
){
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment