Substr in [code] section bug out? [possibly my own browser]

  • Thread starter jbriggs444
  • Start date
  • #1
jbriggs444
Science Advisor
Homework Helper
11,684
6,370
Code:
s u b s t r($a,0,1)
I was attempting to preview before posting.
1656590482182.png
 
  • Like
Likes Wrichik Basu

Answers and Replies

  • #2
Ibix
Science Advisor
Insights Author
2022 Award
10,332
11,080
Can confirm. Putting the s back into the below causes the "Oops" dialog when I attempt to preview - Firefox on Android.
Code:
subtr($a,0,1)
 
  • #4
jbriggs444
Science Advisor
Homework Helper
11,684
6,370
Code:
subtr($a,0,1)

works ok for me
When I attempt to preview this I get:
1656598559969.png

If I attempt to post without preview, I get the same until removing the s.
Same if attempting to Save after edit.
 
  • #5
jack action
Science Advisor
Insights Author
Gold Member
2,707
5,622
Same problem here. Firefox on Ubuntu.

It's actually the string substr() that creates the bug. With or without characters within the brackets; within BBcode or not.

(I actually inserted a non-printable character between the s and the u to be able to publish this post)
 
  • Like
Likes Wrichik Basu
  • #6
Ibix
Science Advisor
Insights Author
2022 Award
10,332
11,080
It looks like I can preview a post containing the forbidden word once (in CODE tags or not), then get the error on anything I try to post (containing the string or not) on a subsequent try. Refreshing the page resets it. Did you try previewing more than once, @Greg Bernhardt?

I'll try on my laptop this evening and see if the browser console says anything - don't think I've got a console in 'Droid Firefox.
 
  • #7
jack action
Science Advisor
Insights Author
Gold Member
2,707
5,622
I checked the console and it is a Cloudflare problem:

Code:
XHR POST https://www.physicsforums.com/threads/substr-in-code-section-bug-out-possibly-my-own-browser.1016515/reply-preview
[HTTP/2 403 Forbidden 45ms]

Followed by an HTML page (yes, in the console) that reads (error set at core-compiled.js:3:1515):

Please enable cookies.
Sorry, you have been blocked
You are unable to access physicsforums.com
Why have I been blocked?

This website is using a security service to protect itself from online attacks. The action you just performed triggered the security solution. There are several actions that could trigger this block including submitting a certain word or phrase, a SQL command or malformed data.
What can I do to resolve this?

You can email the site owner to let them know you were blocked. Please include what you were doing when this page came up and the Cloudflare Ray ID found at the bottom of this page.

Cloudflare Ray ID: 723865b31e5d713f • Your IP:

[my IP adress redacted] • Performance & security by Cloudflare

I was unable to paste the actual HTML code as I was getting another console error:

 
  • Like
  • Informative
Likes mfb, Greg Bernhardt and Wrichik Basu
  • #9
Ibix
Science Advisor
Insights Author
2022 Award
10,332
11,080
Code:
substr
Working for me! Thanks Greg.
 
  • Love
Likes Greg Bernhardt
  • #10
jbriggs444
Science Advisor
Homework Helper
11,684
6,370
Fails when toggling bbcode.

/index.php?editor/to-bb-code:1 Failed to load resource: the server responded with a status of 403 ()

And apologies for ruining your day.
 
  • #12
pbuk
Science Advisor
Homework Helper
Gold Member
4,084
2,411
I want a substr of a string

Edit: worked after a cache flush (shift-refresh) but not before.
 
  • #14
pbuk
Science Advisor
Homework Helper
Gold Member
4,084
2,411
@Greg Bernhardt same issue here with some combinations of "c h a r ( )".

As above the proper fix is for Zenforo to change from Content-type: multipart/form-data to application/json, otherwise you will be patching CDN filter exceptions for ever (or can you just remove the filter altogether: I can't imagine Zenforo is vulnerable to script injection in 2022)?
 

Suggested for: Substr in [code] section bug out? [possibly my own browser]

  • Last Post
Replies
6
Views
735
  • Last Post
Replies
1
Views
144
Replies
8
Views
534
Replies
7
Views
1K
Replies
4
Views
144
Replies
2
Views
494
  • Last Post
Replies
6
Views
2K
  • Last Post
Replies
8
Views
436
  • Last Post
Replies
4
Views
1K
Top