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
a1109273
Commit
a1109273
authored
Jun 23, 2015
by
q2apro.com
Committed by
Scott
Oct 28, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Close with Notice or as Duplicate in one field
parent
5430e6d9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
23 deletions
+9
-23
qa-lang-question.php
qa-include/lang/qa-lang-question.php
+1
-1
question-post.php
qa-include/pages/question-post.php
+8
-22
No files found.
qa-include/lang/qa-lang-question.php
View file @
a1109273
...
@@ -76,7 +76,7 @@
...
@@ -76,7 +76,7 @@
'close_original_note'
=>
'You can also enter the question number from the URL, e.g. 123.'
,
'close_original_note'
=>
'You can also enter the question number from the URL, e.g. 123.'
,
'close_original_title'
=>
'URL of the original question:'
,
'close_original_title'
=>
'URL of the original question:'
,
'close_q_popup'
=>
'Close this question to any new answers'
,
'close_q_popup'
=>
'Close this question to any new answers'
,
'close_reason_title'
=>
'Reason for closing this question:'
,
'close_reason_title'
=>
'Reason for closing this question
or insert the URL of the duplicate question
:'
,
'closed_as_duplicate'
=>
'closed as a duplicate of:'
,
'closed_as_duplicate'
=>
'closed as a duplicate of:'
,
'closed_with_note'
=>
'closed with the note:'
,
'closed_with_note'
=>
'closed with the note:'
,
'comment_a_popup'
=>
'Add a comment on this answer'
,
'comment_a_popup'
=>
'Add a comment on this answer'
,
...
...
qa-include/pages/question-post.php
View file @
a1109273
...
@@ -528,19 +528,10 @@
...
@@ -528,19 +528,10 @@
'title'
=>
qa_lang_html
(
'question/close_form_title'
),
'title'
=>
qa_lang_html
(
'question/close_form_title'
),
'fields'
=>
array
(
'fields'
=>
array
(
'duplicate'
=>
array
(
'type'
=>
'checkbox'
,
'tags'
=>
'name="q_close_duplicate" id="q_close_duplicate" onchange="document.getElementById(\'q_close_details\').focus();"'
,
'label'
=>
qa_lang_html
(
'question/close_duplicate'
),
'value'
=>
@
$in
[
'duplicate'
],
),
'details'
=>
array
(
'details'
=>
array
(
'tags'
=>
'name="q_close_details" id="q_close_details"'
,
'tags'
=>
'name="q_close_details" id="q_close_details"'
,
'label'
=>
'label'
=>
'<span id="close_label_duplicate">'
.
qa_lang_html
(
'question/close_original_title'
)
.
' </span>'
.
'<span id="close_label_other">'
.
qa_lang_html
(
'question/close_reason_title'
)
.
':</span>'
,
'<span id="close_label_other">'
.
qa_lang_html
(
'question/close_reason_title'
)
.
'</span>'
,
'note'
=>
'<span id="close_note_duplicate" style="display:none;">'
.
qa_lang_html
(
'question/close_original_note'
)
.
'</span>'
,
'value'
=>
@
$in
[
'details'
],
'value'
=>
@
$in
[
'details'
],
'error'
=>
qa_html
(
@
$errors
[
'details'
]),
'error'
=>
qa_html
(
@
$errors
[
'details'
]),
),
),
...
@@ -564,12 +555,6 @@
...
@@ -564,12 +555,6 @@
),
),
);
);
qa_set_display_rules
(
$qa_content
,
array
(
'close_label_duplicate'
=>
'q_close_duplicate'
,
'close_label_other'
=>
'!q_close_duplicate'
,
'close_note_duplicate'
=>
'q_close_duplicate'
,
));
$qa_content
[
'focusid'
]
=
'q_close_details'
;
$qa_content
[
'focusid'
]
=
'q_close_details'
;
return
$form
;
return
$form
;
...
@@ -582,18 +567,19 @@
...
@@ -582,18 +567,19 @@
*/
*/
{
{
$in
=
array
(
$in
=
array
(
'duplicate'
=>
qa_post_text
(
'q_close_duplicate'
),
'details'
=>
trim
(
qa_post_text
(
'q_close_details'
)),
'details'
=>
qa_post_text
(
'q_close_details'
),
);
);
$userid
=
qa_get_logged_in_userid
();
$userid
=
qa_get_logged_in_userid
();
$handle
=
qa_get_logged_in_handle
();
$handle
=
qa_get_logged_in_handle
();
$cookieid
=
qa_cookie_get
();
$cookieid
=
qa_cookie_get
();
if
(
!
qa_check_form_security_code
(
'close-'
.
$question
[
'postid'
],
qa_post_text
(
'code'
)))
$isduplicateurl
=
filter_var
(
$in
[
'details'
],
FILTER_VALIDATE_URL
);
$errors
[
'details'
]
=
qa_lang_html
(
'misc/form_security_again'
);
if
(
!
qa_check_form_security_code
(
'close-'
.
$question
[
'postid'
],
qa_post_text
(
'code'
)))
{
elseif
(
$in
[
'duplicate'
])
{
$errors
[
'details'
]
=
qa_lang_html
(
'misc/form_security_again'
);
}
elseif
(
$isduplicateurl
)
{
// be liberal in what we accept, but there are two potential unlikely pitfalls here:
// be liberal in what we accept, but there are two potential unlikely pitfalls here:
// a) URLs could have a fixed numerical path, e.g. http://qa.mysite.com/1/478/...
// a) URLs could have a fixed numerical path, e.g. http://qa.mysite.com/1/478/...
// 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/...
...
...
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