Unable to post when the content contains code (Perl and Bash
Unable to post when the content contains code (Perl and Bash
Author
Discussion

TonyRPH

Original Poster:

13,457 posts

191 months

Sunday 4th October 2020
quotequote all
I just spent several minutes composing a post which contained Perl and Bash script.

I couldn't include it in the code tags so first I tried to quote it, and then just tried posting it as unformatted text.

But PH just issues me with a "Forbidden" error - presumably because something in the code is triggering some kind of protection.

I tried removing various parts to no avail - and in any case it would have rendered the scripts useless to anyone.

This is pretty poor!

The post relates to this thread

I was trying to post this text


jeremyc

27,020 posts

307 months

Sunday 4th October 2020
quotequote all
And the error you received is likely to be related to this thread.

The only fix seems to be to edit the content (and preview) until you have removed the text causing the error.

TonyRPH

Original Poster:

13,457 posts

191 months

Monday 5th October 2020
quotequote all
Cheers for that - there was far too much content to edit and remove until it worked.

Also - it would have broken the potentially useful scripts I was posting.

Oh well - I'll just provide links to them instead.


bigandclever

14,197 posts

261 months

Monday 5th October 2020
quotequote all
It’s the word “mail” in line 12 ...

echo "${kwday} kWh" | M A I L -s "Power usage for $date" <email address goes here>

TonyRPH

Original Poster:

13,457 posts

191 months

Monday 5th October 2020
quotequote all
bigandclever said:
It’s the word “mail” in line 12 ...

echo "${kwday} kWh" | M A I L -s "Power usage for $date" <email address goes here>
Cheers, but there must be more causing a problem.

I just tried posting a tiny snippet of the script and got the dreaded forbidden message.

It doesn't matter, as I have created an entry for the scripts on my knowledge base website, so I'll just post a link to that.

bigandclever

14,197 posts

261 months

Monday 5th October 2020
quotequote all
Fair enough. I can preview (so I assume post) everything in your link by removing “mail”. Of course, all the “#” get converted to ordered numbers, so it gets broken anyway.

TonyRPH

Original Poster:

13,457 posts

191 months

Monday 5th October 2020
quotequote all
bigandclever said:
Fair enough. I can preview (so I assume post) everything in your link by removing “mail”. Of course, all the “#” get converted to ordered numbers, so it gets broken anyway.
That's interesting - but as you say, converting the # to numbers is pointless anyway.

I was testing with the Preview option - I tired numerous different options last night as well.

Thank you for trying though!

beer


tirolo_

279 posts

132 months

Monday 12th October 2020
quotequote all
TonyRPH said:
bigandclever said:
It’s the word “mail” in line 12 ...

echo "${kwday} kWh" | M A I L -s "Power usage for $date" <email address goes here>
Cheers, but there must be more causing a problem.

I just tried posting a tiny snippet of the script and got the dreaded forbidden message.

It doesn't matter, as I have created an entry for the scripts on my knowledge base website, so I'll just post a link to that.
for future reference it often comes down to be anything that looks like a html tag/javascript code. "<email" was probably being caught as an attempt to inject html and further down in your text there was a "<DEV".... that in combination with some other text following it (which is the tricky bit to figure, ie: this text is not triggering it) might have triggered the safety blocks.

It has been mentioned on the post jeremyc pointed out that on a balance of annoyance vs safety a more restrictive algorithm had to be chosen to keep our beloved old forums secure.

Good news is that this is not set in stone, we will eventually be in position to balance the algorithm back into a more convenient one without compromising in safety.

TonyRPH

Original Poster:

13,457 posts

191 months

Monday 12th October 2020
quotequote all
tirolo_ said:
stuff

Thanks - I look forward to the day that PH has proper <code> and <pre> tags etc. as the old triple brace system for inserting code into a post is a bit clunky too.