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

  • Thread starter jbriggs444
  • Start date
In summary, when attempting to preview a post containing the string "substr", the browser throws an error. This error persists even after trying to post the post without previewing it.
  • #1
jbriggs444
Science Advisor
Homework Helper
12,812
7,458
Code:
s u b s t r($a,0,1)
I was attempting to preview before posting.
1656590482182.png
 
  • Like
Likes Wrichik Basu
Physics news on Phys.org
  • #2
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 jbriggs444
  • #3
Code:
substr($a,0,1)

works ok for me
 
  • #4
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.
 
  • #5
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
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
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
Code:
substr
Working for me! Thanks Greg.
 
  • Love
Likes 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 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)?
 

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

1. What is a "Substr in [code] section bug out"?

A "Substr in [code] section bug out" refers to a bug or error that occurs in the code section of a program or website. It is often caused by a problem with the substring function, which is used to extract a portion of a string in programming.

2. How do I know if I am experiencing a "Substr in [code] section bug out"?

If you are experiencing a "Substr in [code] section bug out," you may notice unexpected behavior in the program or website. This could include incorrect or missing information, buttons or links not working, or the program crashing.

3. What causes a "Substr in [code] section bug out"?

A "Substr in [code] section bug out" can be caused by a variety of factors, including incorrect syntax in the code, incompatible code from different sources, or a mistake in the substring function itself. It can also be caused by browser compatibility issues or outdated software.

4. How can I fix a "Substr in [code] section bug out"?

The first step in fixing a "Substr in [code] section bug out" is to identify the root cause. This may require reviewing the code, checking for updates or compatibility issues, or seeking help from a developer or technical support. Once the cause is identified, it can be addressed through debugging, updating the code, or making necessary changes to the program or website.

5. How can I prevent a "Substr in [code] section bug out" from happening?

To prevent a "Substr in [code] section bug out," it is important to test and review code thoroughly before implementing it. Regularly updating software and checking for compatibility issues can also help prevent these types of bugs. Additionally, having a backup plan in case of errors or bugs can help minimize the impact of a "Substr in [code] section bug out."

Similar threads

Replies
4
Views
1K
Replies
3
Views
2K
Replies
3
Views
3K
Replies
3
Views
2K
Replies
3
Views
3K
Replies
1
Views
2K
Back
Top