Bugzilla – Attachment 90531 Details for
Bug 23093
Error during upgrade of OpacNavRight preference to Koha news
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23093: (bug 22318 follow-up) Use placeholders in query moving OpacNavRight
Bug-23093-bug-22318-follow-up-Use-placeholders-in-.patch (text/plain), 1.72 KB, created by
Nick Clemens (kidclamp)
on 2019-06-12 13:55:46 UTC
(
hide
)
Description:
Bug 23093: (bug 22318 follow-up) Use placeholders in query moving OpacNavRight
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2019-06-12 13:55:46 UTC
Size:
1.72 KB
patch
obsolete
>From 45cdfc2326aa8ad1d4c537a058e55ae4a0169ec1 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 11 Jun 2019 09:24:28 -0500 >Subject: [PATCH] Bug 23093: (bug 22318 follow-up) Use placeholders in query > moving OpacNavRight > >Placeholders must be used (!) in all SQL queries. > >Test plan: >1/ % git checkout 0c95e22afe13349b60d134217fce6718bfa9727f # commit before bug 22318 >2/ Edit the pref OpacNavRight with something with " > just a " and more ' >3/ git checkout master >4/ restart_all >5/ run updatedatabase.pl >=> Boom and the content of the pref has been lost >6/ Repeat 1 to 3 >7/ Apply this patch >8/ run updatedatabase.pl >=> The pref has been correctly moved to opac_news > >Signed-off-by: Mark Tompsett <mtompset@hotmail.com> > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > installer/data/mysql/updatedatabase.pl | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 1d68a30617..ba6f8861e0 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -18217,7 +18217,7 @@ if( CheckVersion( $DBversion ) ) { > |); > if( $OpacNavRight ){ > # If there is a value in the OpacNavRight preference, insert it into opac_news >- $dbh->do("INSERT INTO opac_news (branchcode, lang, title, content ) VALUES (NULL, 'OpacNavRight_$langs[0]', '', '$OpacNavRight')"); >+ $dbh->do("INSERT INTO opac_news (branchcode, lang, title, content ) VALUES (NULL, ?, '', ?)", undef, "OpacNavRight_$langs[0]", $OpacNavRight); > } > # Remove the OpacNavRight system preference > $dbh->do("DELETE FROM systempreferences WHERE variable='OpacNavRight'"); >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 23093
:
90494
|
90500
| 90531