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
ed8194f6
Commit
ed8194f6
authored
Feb 18, 2014
by
pupi1985
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed some unneeded ternary operators
parent
21dab95f
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
28 additions
and
29 deletions
+28
-29
qa-app-options.php
qa-include/qa-app-options.php
+4
-4
qa-app-post-update.php
qa-include/qa-app-post-update.php
+2
-2
qa-app-q-list.php
qa-include/qa-app-q-list.php
+1
-1
qa-db-admin.php
qa-include/qa-db-admin.php
+2
-2
qa-page-account.php
qa-include/qa-page-account.php
+2
-3
qa-page-ask.php
qa-include/qa-page-ask.php
+2
-2
qa-page-login.php
qa-include/qa-page-login.php
+2
-2
qa-page-question-post.php
qa-include/qa-page-question-post.php
+3
-3
qa-page-question-submit.php
qa-include/qa-page-question-submit.php
+6
-6
qa-page-user-profile.php
qa-include/qa-page-user-profile.php
+3
-3
qa-util-string.php
qa-include/qa-util-string.php
+1
-1
No files found.
qa-include/qa-app-options.php
View file @
ed8194f6
...
...
@@ -390,19 +390,19 @@
break
;
case
'show_custom_sidebar'
:
$value
=
strlen
(
qa_opt
(
'custom_sidebar'
))
?
true
:
false
;
$value
=
(
bool
)
strlen
(
qa_opt
(
'custom_sidebar'
))
;
break
;
case
'show_custom_header'
:
$value
=
strlen
(
qa_opt
(
'custom_header'
))
?
true
:
false
;
$value
=
(
bool
)
strlen
(
qa_opt
(
'custom_header'
))
;
break
;
case
'show_custom_footer'
:
$value
=
strlen
(
qa_opt
(
'custom_footer'
))
?
true
:
false
;
$value
=
(
bool
)
strlen
(
qa_opt
(
'custom_footer'
))
;
break
;
case
'show_custom_in_head'
:
$value
=
strlen
(
qa_opt
(
'custom_in_head'
))
?
true
:
false
;
$value
=
(
bool
)
strlen
(
qa_opt
(
'custom_in_head'
))
;
break
;
case
'custom_sidebar'
:
...
...
qa-include/qa-app-post-update.php
View file @
ed8194f6
...
...
@@ -55,9 +55,9 @@
qa_post_unindex
(
$oldquestion
[
'postid'
]);
$wasqueued
=
(
$oldquestion
[
'type'
]
==
'Q_QUEUED'
);
$titlechanged
=
strcmp
(
$oldquestion
[
'title'
],
$title
)
?
true
:
false
;
$titlechanged
=
(
bool
)
strcmp
(
$oldquestion
[
'title'
],
$title
)
;
$contentchanged
=
strcmp
(
$oldquestion
[
'content'
],
$content
)
||
strcmp
(
$oldquestion
[
'format'
],
$format
);
$tagschanged
=
strcmp
(
$oldquestion
[
'tags'
],
$tagstring
)
?
true
:
false
;
$tagschanged
=
(
bool
)
strcmp
(
$oldquestion
[
'tags'
],
$tagstring
)
;
$setupdated
=
(
$titlechanged
||
$contentchanged
||
$tagschanged
)
&&
(
!
$wasqueued
)
&&
!
$silent
;
qa_db_post_set_content
(
$oldquestion
[
'postid'
],
$title
,
$content
,
$format
,
$tagstring
,
$notify
,
...
...
qa-include/qa-app-q-list.php
View file @
ed8194f6
...
...
@@ -93,7 +93,7 @@
if
(
isset
(
$userid
)
&&
isset
(
$categoryid
))
{
$favoritemap
=
qa_get_favorite_non_qs_map
();
$categoryisfavorite
=@
$favoritemap
[
'category'
][
$navcategories
[
$categoryid
][
'backpath'
]]
?
true
:
false
;
$categoryisfavorite
=
(
bool
)
@
$favoritemap
[
'category'
][
$navcategories
[
$categoryid
][
'backpath'
]]
;
$qa_content
[
'favorite'
]
=
qa_favorite_form
(
QA_ENTITY_CATEGORY
,
$categoryid
,
$categoryisfavorite
,
qa_lang_sub
(
$categoryisfavorite
?
'main/remove_x_favorites'
:
'main/add_category_x_favorites'
,
$navcategories
[
$categoryid
][
'title'
]));
...
...
qa-include/qa-db-admin.php
View file @
ed8194f6
...
...
@@ -220,7 +220,7 @@
Return whether there are any blobs whose content has been stored as a file on disk
*/
{
return
count
(
qa_db_read_all_values
(
qa_db_query_sub
(
'SELECT blobid FROM ^blobs WHERE content IS NULL LIMIT 1'
)))
?
true
:
false
;
return
(
bool
)
count
(
qa_db_read_all_values
(
qa_db_query_sub
(
'SELECT blobid FROM ^blobs WHERE content IS NULL LIMIT 1'
)))
;
}
...
...
@@ -229,7 +229,7 @@
Return whether there are any blobs whose content has been stored in the database
*/
{
return
count
(
qa_db_read_all_values
(
qa_db_query_sub
(
'SELECT blobid FROM ^blobs WHERE content IS NOT NULL LIMIT 1'
)))
?
true
:
false
;
return
(
bool
)
count
(
qa_db_read_all_values
(
qa_db_query_sub
(
'SELECT blobid FROM ^blobs WHERE content IS NOT NULL LIMIT 1'
)))
;
}
...
...
qa-include/qa-page-account.php
View file @
ed8194f6
...
...
@@ -60,7 +60,7 @@
$doconfirms
=
qa_opt
(
'confirm_user_emails'
)
&&
(
$useraccount
[
'level'
]
<
QA_USER_LEVEL_EXPERT
);
$isconfirmed
=
(
$useraccount
[
'flags'
]
&
QA_USER_FLAGS_EMAIL_CONFIRMED
)
?
true
:
false
;
$haspassword
=
isset
(
$useraccount
[
'passsalt'
])
&&
isset
(
$useraccount
[
'passcheck'
]);
$isblocked
=
qa_user_permit_error
()
?
true
:
false
;
$isblocked
=
(
bool
)
qa_user_permit_error
()
;
// Process profile if saved
...
...
@@ -439,4 +439,4 @@
/*
Omit PHP closing tag to help avoid accidental output
*/
\ No newline at end of file
*/
qa-include/qa-page-ask.php
View file @
ed8194f6
...
...
@@ -110,9 +110,9 @@
$userlevel
=
qa_user_level_for_categories
(
$categoryids
);
$in
[
'name'
]
=
qa_post_text
(
'name'
);
$in
[
'notify'
]
=
qa_post_text
(
'notify'
)
?
true
:
false
;
$in
[
'notify'
]
=
(
bool
)
qa_post_text
(
'notify'
)
;
$in
[
'email'
]
=
qa_post_text
(
'email'
);
$in
[
'queued'
]
=
qa_user_moderation_reason
(
$userlevel
)
?
true
:
false
;
$in
[
'queued'
]
=
(
bool
)
qa_user_moderation_reason
(
$userlevel
)
;
qa_get_post_content
(
'editor'
,
'content'
,
$in
[
'editor'
],
$in
[
'content'
],
$in
[
'format'
],
$in
[
'text'
]);
...
...
qa-include/qa-page-login.php
View file @
ed8194f6
...
...
@@ -75,7 +75,7 @@
if
(
strtolower
(
qa_db_calc_passcheck
(
$inpassword
,
$userinfo
[
'passsalt'
]))
==
strtolower
(
$userinfo
[
'passcheck'
]))
{
// login and redirect
require_once
QA_INCLUDE_DIR
.
'qa-app-users.php'
;
qa_set_logged_in_user
(
$inuserid
,
$userinfo
[
'handle'
],
$inremember
?
true
:
false
);
qa_set_logged_in_user
(
$inuserid
,
$userinfo
[
'handle'
],
(
bool
)
$inremember
);
$topath
=
qa_get
(
'to'
);
...
...
@@ -143,7 +143,7 @@
'type'
=>
'checkbox'
,
'label'
=>
qa_lang_html
(
'users/remember_label'
),
'tags'
=>
'name="remember"'
,
'value'
=>
@
$inremember
?
true
:
false
,
'value'
=>
(
bool
)
@
$inremember
,
),
),
...
...
qa-include/qa-page-question-post.php
View file @
ed8194f6
...
...
@@ -450,7 +450,7 @@
if
(
$question
[
'isbyuser'
])
{
$in
[
'name'
]
=
qa_post_text
(
'q_name'
);
$in
[
'notify'
]
=
qa_post_text
(
'q_notify'
)
?
true
:
false
;
$in
[
'notify'
]
=
(
bool
)
qa_post_text
(
'q_notify'
)
;
$in
[
'email'
]
=
qa_post_text
(
'q_email'
);
}
...
...
@@ -781,7 +781,7 @@
if
(
$answer
[
'isbyuser'
])
{
$in
[
'name'
]
=
qa_post_text
(
$prefix
.
'name'
);
$in
[
'notify'
]
=
qa_post_text
(
$prefix
.
'notify'
)
?
true
:
false
;
$in
[
'notify'
]
=
(
bool
)
qa_post_text
(
$prefix
.
'notify'
)
;
$in
[
'email'
]
=
qa_post_text
(
$prefix
.
'email'
);
}
...
...
@@ -982,7 +982,7 @@
if
(
$comment
[
'isbyuser'
])
{
$in
[
'name'
]
=
qa_post_text
(
$prefix
.
'name'
);
$in
[
'notify'
]
=
qa_post_text
(
$prefix
.
'notify'
)
?
true
:
false
;
$in
[
'notify'
]
=
(
bool
)
qa_post_text
(
$prefix
.
'notify'
)
;
$in
[
'email'
]
=
qa_post_text
(
$prefix
.
'email'
);
}
...
...
qa-include/qa-page-question-submit.php
View file @
ed8194f6
...
...
@@ -324,9 +324,9 @@
{
$in
=
array
(
'name'
=>
qa_post_text
(
'a_name'
),
'notify'
=>
qa_post_text
(
'a_notify'
)
?
true
:
false
,
'notify'
=>
(
bool
)
qa_post_text
(
'a_notify'
)
,
'email'
=>
qa_post_text
(
'a_email'
),
'queued'
=>
qa_user_moderation_reason
(
qa_user_level_for_post
(
$question
))
?
true
:
false
,
'queued'
=>
(
bool
)
qa_user_moderation_reason
(
qa_user_level_for_post
(
$question
))
,
);
qa_get_post_content
(
'a_editor'
,
'a_content'
,
$in
[
'editor'
],
$in
[
'content'
],
$in
[
'format'
],
$in
[
'text'
]);
...
...
@@ -386,9 +386,9 @@
$in
=
array
(
'name'
=>
qa_post_text
(
$prefix
.
'name'
),
'notify'
=>
qa_post_text
(
$prefix
.
'notify'
)
?
true
:
false
,
'notify'
=>
(
bool
)
qa_post_text
(
$prefix
.
'notify'
)
,
'email'
=>
qa_post_text
(
$prefix
.
'email'
),
'queued'
=>
qa_user_moderation_reason
(
qa_user_level_for_post
(
$parent
))
?
true
:
false
,
'queued'
=>
(
bool
)
qa_user_moderation_reason
(
qa_user_level_for_post
(
$parent
))
,
);
qa_get_post_content
(
$prefix
.
'editor'
,
$prefix
.
'content'
,
$in
[
'editor'
],
$in
[
'content'
],
$in
[
'format'
],
$in
[
'text'
]);
...
...
@@ -443,9 +443,9 @@
'content'
=>
$post
[
'content'
],
'format'
=>
$post
[
'format'
],
'text'
=>
qa_viewer_text
(
$post
[
'content'
],
$post
[
'format'
]),
'notify'
=>
isset
(
$post
[
'notify'
])
?
true
:
false
,
'notify'
=>
isset
(
$post
[
'notify'
]),
'email'
=>
qa_email_validate
(
$post
[
'notify'
])
?
$post
[
'notify'
]
:
null
,
'queued'
=>
qa_user_moderation_reason
(
qa_user_level_for_post
(
$post
))
?
true
:
false
,
'queued'
=>
(
bool
)
qa_user_moderation_reason
(
qa_user_level_for_post
(
$post
))
,
);
if
(
$post
[
'basetype'
]
==
'Q'
)
{
...
...
qa-include/qa-page-user-profile.php
View file @
ed8194f6
...
...
@@ -435,7 +435,7 @@
// Category-specific levels
if
(
qa_using_categories
())
{
$catleveladd
=
qa_get
(
'catleveladd'
)
?
true
:
false
;
$catleveladd
=
(
bool
)
qa_get
(
'catleveladd'
)
;
if
((
!
$catleveladd
)
&&
!
count
(
$userlevels
))
$qa_content
[
'form_profile'
][
'fields'
][
'level'
][
'suffix'
]
=
strtr
(
qa_lang_html
(
'users/category_level_add'
),
array
(
...
...
@@ -547,7 +547,7 @@
if
((
$loginlevel
>=
QA_USER_LEVEL_ADMIN
)
&&
!
qa_user_permit_error
())
{
$doconfirms
=
qa_opt
(
'confirm_user_emails'
)
&&
(
$useraccount
[
'level'
]
<
QA_USER_LEVEL_EXPERT
);
$isconfirmed
=
(
$useraccount
[
'flags'
]
&
QA_USER_FLAGS_EMAIL_CONFIRMED
)
?
true
:
false
;
$isconfirmed
=
(
bool
)
(
$useraccount
[
'flags'
]
&
QA_USER_FLAGS_EMAIL_CONFIRMED
)
;
$htmlemail
=
qa_html
(
isset
(
$inemail
)
?
$inemail
:
$useraccount
[
'email'
]);
$qa_content
[
'form_profile'
][
'fields'
][
'email'
]
=
array
(
...
...
@@ -610,7 +610,7 @@
if
(
!
isset
(
$value
))
$value
=@
$userprofile
[
$userfield
[
'title'
]];
$valuehtml
=
qa_html
(
$value
,
((
$userfield
[
'flags'
]
&
QA_FIELD_FLAGS_MULTI_LINE
)
&&
!
$fieldsediting
)
?
true
:
false
);
$valuehtml
=
qa_html
(
$value
,
((
$userfield
[
'flags'
]
&
QA_FIELD_FLAGS_MULTI_LINE
)
&&
!
$fieldsediting
));
}
$label
=
trim
(
qa_user_userfield_label
(
$userfield
),
':'
);
...
...
qa-include/qa-util-string.php
View file @
ed8194f6
...
...
@@ -646,7 +646,7 @@
{
if
(
qa_to_override
(
__FUNCTION__
))
{
$args
=
func_get_args
();
return
qa_call_override
(
__FUNCTION__
,
$args
);
}
return
preg_match
(
"/^[\-\!\#
\$
\%\&\'\*\+\/\=\?\_\`\{\|\}\~a-zA-Z0-9\.\^]+\@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\.\-]+$/"
,
$email
)
?
true
:
false
;
return
(
bool
)
preg_match
(
"/^[\-\!\#
\$
\%\&\'\*\+\/\=\?\_\`\{\|\}\~a-zA-Z0-9\.\^]+\@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\.\-]+$/"
,
$email
)
;
}
...
...
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