Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Q
question2answer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
outils
question2answer
Commits
1a136591
Commit
1a136591
authored
Nov 08, 2016
by
pupi1985
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix unencoded URLs not being detected when closing questions
parent
f22e8abb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
question-post.php
qa-include/pages/question-post.php
+3
-2
No files found.
qa-include/pages/question-post.php
View file @
1a136591
...
@@ -577,7 +577,8 @@ function qa_page_q_close_q_submit($question, $closepost, &$in, &$errors)
...
@@ -577,7 +577,8 @@ function qa_page_q_close_q_submit($question, $closepost, &$in, &$errors)
$handle
=
qa_get_logged_in_handle
();
$handle
=
qa_get_logged_in_handle
();
$cookieid
=
qa_cookie_get
();
$cookieid
=
qa_cookie_get
();
$isduplicateurl
=
filter_var
(
$in
[
'details'
],
FILTER_VALIDATE_URL
);
$sanitizedUrl
=
filter_var
(
$in
[
'details'
],
FILTER_SANITIZE_URL
);
$isduplicateurl
=
filter_var
(
$sanitizedUrl
,
FILTER_VALIDATE_URL
);
if
(
!
qa_check_form_security_code
(
'close-'
.
$question
[
'postid'
],
qa_post_text
(
'code'
)))
{
if
(
!
qa_check_form_security_code
(
'close-'
.
$question
[
'postid'
],
qa_post_text
(
'code'
)))
{
$errors
[
'details'
]
=
qa_lang_html
(
'misc/form_security_again'
);
$errors
[
'details'
]
=
qa_lang_html
(
'misc/form_security_again'
);
...
@@ -587,7 +588,7 @@ function qa_page_q_close_q_submit($question, $closepost, &$in, &$errors)
...
@@ -587,7 +588,7 @@ function qa_page_q_close_q_submit($question, $closepost, &$in, &$errors)
// b) There could be a question title which is just a number, e.g. http://qa.mysite.com/478/12345/...
// b) There could be a question title which is just a number, e.g. http://qa.mysite.com/478/12345/...
// so we check if more than one question could match, and if so, show an error
// so we check if more than one question could match, and if so, show an error
$parts
=
preg_split
(
'|[=/&]|'
,
$
in
[
'details'
]
,
-
1
,
PREG_SPLIT_NO_EMPTY
);
$parts
=
preg_split
(
'|[=/&]|'
,
$
sanitizedUrl
,
-
1
,
PREG_SPLIT_NO_EMPTY
);
$keypostids
=
array
();
$keypostids
=
array
();
foreach
(
$parts
as
$part
)
{
foreach
(
$parts
as
$part
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment