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
b0d15b92
Commit
b0d15b92
authored
Jan 19, 2019
by
Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unreachable code from qa-db.php
Plus add deprecation notices.
parent
81dc9e36
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
8 additions
and
8 deletions
+8
-8
hotness.php
qa-include/db/hotness.php
+2
-2
points.php
qa-include/db/points.php
+2
-2
qa-base.php
qa-include/qa-base.php
+1
-1
qa-db.php
qa-include/qa-db.php
+0
-0
DbConnection.php
qa-src/Database/DbConnection.php
+1
-1
DbResult.php
qa-src/Database/DbResult.php
+2
-2
No files found.
qa-include/db/hotness.php
View file @
b0d15b92
...
...
@@ -35,9 +35,9 @@ function qa_db_increment_views($postid)
$query
=
'UPDATE ^posts SET views=views+1, lastviewip=UNHEX($) WHERE postid=# AND (lastviewip IS NULL OR lastviewip!=UNHEX($))'
;
$ipHex
=
bin2hex
(
@
inet_pton
(
qa_remote_ip_address
()));
qa_db_query_sub
(
$query
,
$ipHex
,
$postid
,
$ipHex
);
$result
=
qa_db_query_sub
(
$query
,
$ipHex
,
$postid
,
$ipHex
);
return
qa_db_affected_r
ows
()
>
0
;
return
$result
->
affectedR
ows
()
>
0
;
}
...
...
qa-include/db/points.php
View file @
b0d15b92
...
...
@@ -206,9 +206,9 @@ function qa_db_points_update_ifuser($userid, $columns)
'ON DUPLICATE KEY UPDATE '
.
$updates
.
'points='
.
$updatepoints
.
'+bonus'
;
// build like this so that a #, $ or ^ character in the $userid (if external integration) isn't substituted
qa_db_query_raw
(
str_replace
(
'~'
,
"='"
.
qa_db_escape_string
(
$userid
)
.
"'"
,
qa_db_apply_sub
(
$query
,
array
(
$userid
))));
$result
=
qa_db_query_raw
(
str_replace
(
'~'
,
"='"
.
qa_db_escape_string
(
$userid
)
.
"'"
,
qa_db_apply_sub
(
$query
,
array
(
$userid
))));
if
(
qa_db_insert_on_duplicate_inserted
()
)
{
if
(
$result
->
affectedRows
()
>
0
)
{
qa_db_userpointscount_update
();
}
}
...
...
qa-include/qa-base.php
View file @
b0d15b92
...
...
@@ -1901,7 +1901,7 @@ function qa_opt($name, $value = null)
*/
function
qa_debug
(
$var
)
{
echo
"
\n
"
.
'<pre style="padding: 10px; background-color: #eee; color: #444; font-size: 1
1px; text-align: left
">'
;
echo
"
\n
"
.
'<pre style="padding: 10px; background-color: #eee; color: #444; font-size: 1
2px; text-align: left; white-space: pre-wrap
">'
;
echo
$var
===
null
?
'NULL'
:
htmlspecialchars
(
print_r
(
$var
,
true
),
ENT_COMPAT
|
ENT_SUBSTITUTE
);
echo
'</pre>'
.
"
\n
"
;
}
...
...
qa-include/qa-db.php
View file @
b0d15b92
This diff is collapsed.
Click to expand it.
qa-src/Database/DbConnection.php
View file @
b0d15b92
...
...
@@ -302,7 +302,7 @@ class DbConnection
$arraykey
=
isset
(
$selectspec
[
'arraykey'
])
?
$selectspec
[
'arraykey'
]
:
null
;
$result
=
$this
->
query
(
$query
,
$params
);
$data
=
$result
->
fetchAllAssoc
(
$arraykey
);
// arrayvalue is applied in
qa_db_post_s
elect()
$data
=
$result
->
fetchAllAssoc
(
$arraykey
);
// arrayvalue is applied in
formatS
elect()
$this
->
formatSelect
(
$data
,
$selectspec
);
// post-processing
...
...
qa-src/Database/DbResult.php
View file @
b0d15b92
...
...
@@ -128,7 +128,7 @@ class DbResult
* Number of rows found (SELECT queries) or rows affected (UPDATE/INSERT/DELETE queries).
* @return int
*/
public
function
rowCount
()
public
function
affectedRows
()
{
return
$this
->
stmt
->
rowCount
();
}
...
...
@@ -140,7 +140,7 @@ class DbResult
*/
public
function
isEmpty
()
{
return
$this
->
stmt
->
rowCount
()
===
0
;
return
$this
->
affectedRows
()
===
0
;
}
/**
...
...
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