DataMascara / cisc3140-su19-project

https://bc-app-class.herokuapp.com/login/
2 stars 5 forks source link

Posts Not Submitting; Page Just Refreshes On "Submit Post" #77

Closed mary060196 closed 5 years ago

Maker-Mark commented 5 years ago

Not reproducible. Please provide steps to reproduce this. Closed for now

mary060196 commented 5 years ago

Here is what I write on the post. After I click submit, it happens again. I refreshed the page before that. Maybe the issue is with the single quote mark (')? image

derickfan commented 5 years ago

Yea looks like the ' is breaking it. I'll look into it tomorrow. Thanks

mary060196 commented 5 years ago

O.K. Thank you very much, @derickfan .

LoadingUser3 commented 5 years ago

This \ also breaks comments and posts

mary060196 commented 5 years ago

@LoadingUser3 , your comment is very helpful towards understanding what the issue is about. Since the characters that create problems are ", ' and /, it is believable that the reason for the break is character escaping. In other words, I could build a JS function to add another / before any such character, which would allow the processing of these three. I'll try to do this first in the "Write Post" page to see if the function works, and then if it does on other pages where people can enter any kind of input. Thank you very much for the inspiration!

LoadingUser3 commented 5 years ago

@mary060196 The / (forward slash) does work for comments and posts, it's the \ (back slash) that does not.

I'm glad that this helps with finding the issue!

mary060196 commented 5 years ago

Yes, you're right - it's the backslash! The backslash is the one that is used for escaping: \', \" and \. And thank you for checking about the forward-slash as well. Once the function is added, I'll check how posts submit with any keyboard character in them. Thank you so much for this!

LoadingUser3 commented 5 years ago

I've checked most of them already (at least just for comments) under p/app_hacks, the post named "Check 2".

mary060196 commented 5 years ago

@LoadingUser3 , that's a great job! The function, then, will address these specific ones. I'd also add escaping for " in any case (that won't hurt the code anyway). Thank you very much!

LoadingUser3 commented 5 years ago

Here's another weird thing I found (or maybe it's intentional?) involving the Post Title:

The following sentence is 99 characters long:

Checking multiple lines, double space, 12 font, 18 pages, laminated, hard copy due 8-16-2019 @16:15

It will successfully post if I leave it as is in the Post Title field.

If I add any character to it, including a space, it will also post. (100 characters)

If I add something on top of the above else that puts it above 100 characters (two spaces count!), it will not post and the same exact issue as with the ' and \ (page refreshes without submitting, you can no longer choose community).

Is the character limit for Post Titles 100 characters?

Oddly enough, having more than 100 characters of a looping "1234567890" would post.

(Most tests were made under the p/app_hacks, sorry for the mess that's there, hoping for delete posts feature eventually)

mary060196 commented 5 years ago

Yes, @LoadingUser3 . There's a limit of 100 characters for post titles in the database, which prevents more than 100 chars to be posted.

LoadingUser3 commented 5 years ago

Just making sure, should probably not let the user go above 100 though.

Thank you for letting me know!

mary060196 commented 5 years ago

You are right. I'll also add a limitation in JS to disallow more than 100 characters to be inserted. Thank you very much!

mary060196 commented 5 years ago

@LoadingUser3 , Now every post (title + text) and every comment (both to posts and other comments) can contain the special characters: ', \ , \t, \r, \0, \v, \f just as they are. Try them out, and try many of them in a sequence. Another problem that remains is making new lines, which I'll do tomorrow evening. I'll also add the limitation to post title of 100 char tomorrow. Since this specific issue has been solved, I am closing it, and creating two issues for the issues I mentioned here. Thank you so much for you responsiveness!