Skip to content

Commit

Permalink
Fix execSQL usage mistake, update ldflags variables in Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua Merrell committed May 26, 2018
1 parent cf3535b commit 5d7821c
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 16 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ GOCHAN_DEBUG=1
GOCHAN_VERBOSE=2
GOCHAN_VERBOSITY=0 # This is set by "make release/debug/verbose"

GOCHAN_VERSION=1.9.2
GOCHAN_VERSION=1.9.3
GOCHAN_BUILDTIME=$(shell date +%y%m%d.%H%M)
ifeq ($(GOOS), windows)
GOCHAN_BIN=gochan.exe
Expand Down Expand Up @@ -33,4 +33,4 @@ ifndef GOPATH
endif
@echo ${GOCHAN_VERBOSITY}
@echo ${GOCHAN_VERBOSE}
go build -v -ldflags "-w -X main.version=${GOCHAN_VERSION} -X main.buildtime_str=${GOCHAN_BUILDTIME} -X main.verbosity_str=${GOCHAN_VERBOSITY}" -o ${DIRNAME}${GOCHAN_BIN} ./src
go build -v -ldflags "-w -X main.version=${GOCHAN_VERSION} -X main.buildtimeString=${GOCHAN_BUILDTIME} -X main.verbosityString=${GOCHAN_VERBOSITY}" -o ${DIRNAME}${GOCHAN_BIN} ./src
2 changes: 1 addition & 1 deletion dist.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

VERSION=1.9.2
VERSION=1.9.3
GOOS_ORIG=$GOOS

function copyStuff {
Expand Down
2 changes: 1 addition & 1 deletion html/error/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
<h1>404: File not found</h1>
<img src="/error/lol 404.gif" border="0" alt="">
<p>The requested file could not be found on this server. Are you just typing random stuff in the address bar? If you followed a link from this site here, then post <a href="/site">here</a></p>
<hr><address>http://gochan.org powered by Gochan v1.9.2</address>
<hr><address>http://gochan.org powered by Gochan v1.9.3</address>
</body>
</html>
2 changes: 1 addition & 1 deletion html/error/500.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
<h1>500: Internal Server error</h1>
<img src="/error/derpy server.gif" border="0" alt="">
<p>The server encountered an error while trying to serve the page, and we apologize for the inconvenience. The <a href="https://en.wikipedia.org/wiki/Idiot">system administrator</a> will try to fix things as soon has he/she/it can.</p>
<hr><address>http://gochan.org powered by Gochan v1.9.2</address>
<hr><address>http://gochan.org powered by Gochan v1.9.3</address>
</body>
</html>
18 changes: 8 additions & 10 deletions src/manage.go
Original file line number Diff line number Diff line change
Expand Up @@ -645,15 +645,13 @@ var manage_functions = map[string]ManageFunction{
"`anonymous`,`forced_anon`,`max_age`,`autosage_after`,`no_images_after`,`max_message_length`,`embeds_allowed`,"+
"`redirect_to_thread`,`require_file`,`enable_catalog`) "+
"VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",
[]interface{}{
&board.Order, &board.Dir, &board.Type, &board.UploadType,
&board.Title, &board.Subtitle, &board.Description, &board.Section,
&board.MaxImageSize, &board.MaxPages, &board.Locale, &board.DefaultStyle,
&board.Locked, &boardCreationTimestamp, &board.Anonymous,
&board.ForcedAnon, &board.MaxAge, &board.AutosageAfter,
&board.NoImagesAfter, &board.MaxMessageLength, &board.EmbedsAllowed,
&board.RedirectToThread, &board.RequireFile, &board.EnableCatalog,
},
&board.Order, &board.Dir, &board.Type, &board.UploadType,
&board.Title, &board.Subtitle, &board.Description, &board.Section,
&board.MaxImageSize, &board.MaxPages, &board.Locale, &board.DefaultStyle,
&board.Locked, &boardCreationTimestamp, &board.Anonymous,
&board.ForcedAnon, &board.MaxAge, &board.AutosageAfter,
&board.NoImagesAfter, &board.MaxMessageLength, &board.EmbedsAllowed,
&board.RedirectToThread, &board.RequireFile, &board.EnableCatalog,
); err != nil {
do = ""
board_creation_status = handleError(1, "Error creating board: "+customError(err))
Expand All @@ -673,7 +671,7 @@ var manage_functions = map[string]ManageFunction{
// resetBoardSectionArrays()
default:
// put the default column values in the text boxes
rows, err = querySQL("SELECT `column_name`,`columnDefault` FROM `information_schema`.`columns` WHERE `table_name` = '" + config.DBprefix + "boards'")
rows, err = querySQL("SELECT `column_name`,`column_default` FROM `information_schema`.`columns` WHERE `table_name` = '" + config.DBprefix + "boards'")
if err != nil {
html += handleError(1, "Error getting column names from boards table:"+err.Error())
return
Expand Down
2 changes: 1 addition & 1 deletion src/posting.go
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ func buildBoardListJSON() (html string) {
// bumps the given thread on the given board and returns true if there were no errors
func bumpThread(postID, boardID int) error {
_, err := execSQL("UPDATE `"+config.DBprefix+"posts` SET `bumped` = ? WHERE `id` = ? AND `boardid` = ?",
[]interface{}{time.Now(), postID, boardID},
time.Now(), postID, boardID,
)

return err
Expand Down

0 comments on commit 5d7821c

Please sign in to comment.