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

  • Thread starter Thread starter jbriggs444
  • Start date Start date
jbriggs444
Science Advisor
Homework Helper
Messages
13,417
Reaction score
8,084
Code:
s u b s t r($a,0,1)
I was attempting to preview before posting.
1656590482182.png
 
  • Like
Likes   Reactions: Wrichik Basu
Physics news on Phys.org
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)
 
  • Like
Likes   Reactions: jbriggs444
Greg Bernhardt said:
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.
 
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   Reactions: Wrichik Basu
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.
 
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 address redacted] • Performance & security by Cloudflare

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

 
  • Like
  • Informative
Likes   Reactions: mfb, Greg Bernhardt and Wrichik Basu
I've made an adjustment to a CF rule. Can someone try again?
 
  • Like
Likes   Reactions: Ibix
Code:
substr
Working for me! Thanks Greg.
 
  • Love
Likes   Reactions: Greg Bernhardt
  • #10
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.
 
  • #11
jbriggs444 said:
And apologies for ruining your day.
no way, this is all good to know and fix!

ok I added another rule, try again
 
  • #12
I want a substr of a string

Edit: worked after a cache flush (shift-refresh) but not before.
 
  • #13
Works for me.
 
  • Like
Likes   Reactions: Greg Bernhardt
  • #14
@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)?
 

Similar threads

  • · Replies 11 ·
Replies
11
Views
819
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 6 ·
Replies
6
Views
1K
Replies
11
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
Replies
12
Views
3K