Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
graphql_compose_preview
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
graphql_compose_preview
Commits
04670060
Commit
04670060
authored
1 year ago
by
Al Munnings
Browse files
Options
Downloads
Patches
Plain Diff
Throw to be safer
parent
968bc36c
No related branches found
No related tags found
No related merge requests found
Pipeline
#141253
passed
1 year ago
Stage: build
Stage: validate
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/KeyValueStore/DatabaseStorageExpirableToken.php
+5
-2
5 additions, 2 deletions
src/KeyValueStore/DatabaseStorageExpirableToken.php
with
5 additions
and
2 deletions
src/KeyValueStore/DatabaseStorageExpirableToken.php
+
5
−
2
View file @
04670060
...
...
@@ -37,7 +37,11 @@ class DatabaseStorageExpirableToken extends DatabaseStorageExpirable {
$token
=
preg_replace
(
'/[^a-z0-9_-]/i'
,
''
,
$token
);
$token
=
trim
(
$token
);
return
empty
(
$token
)
?
''
:
sprintf
(
'%%;s:13:"preview_token";s:%d:"%s";%%'
,
strlen
(
$token
),
$token
);
if
(
empty
(
$token
))
{
throw
new
\InvalidArgumentException
(
'Invalid token value.'
);
}
return
sprintf
(
'%%;s:13:"preview_token";s:%d:"%s";%%'
,
strlen
(
$token
),
$token
);
}
/**
...
...
@@ -51,7 +55,6 @@ class DatabaseStorageExpirableToken extends DatabaseStorageExpirable {
*/
public
function
getKeyByToken
(
?string
$token
)
{
try
{
// Search for the token.
$data
=
$this
->
connection
->
query
(
'SELECT [name], [value] FROM {'
.
$this
->
connection
->
escapeTable
(
$this
->
table
)
.
'} WHERE value LIKE :token AND collection = :collection'
,
[
...
...
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