Hack: verify open tags
Posted by Stoebi
All files from this thread
File Name | File Size | Posted by | Date | ||
---|---|---|---|---|---|
OpenTagHack.zip | 11.9 KB | open | download | Stoebi | 09/09/2004 | Read message |
OpenTagHack0.2.zip | 11.9 KB | open | download | Stoebi | 09/09/2004 | Read message |
Hack: verify open tags September 09, 2004 09:03AM |
Registered: 19 years ago Posts: 60 |
Hi,
with the newest cvs 'phorum5-cvs-2004090905.tar.gz' comes a hack from a friend of mine.
An archive is attached so you need no manually patch the files post.php and english.php.
1st
Copy post.php to your phorum root and english.php to the ./include/lang/ folder.
2nd
Copy the file parse_object.php to your ./include folder.
That's all.
Try now to post a message with tags like [ b ], [ url ], [ code ] etc. Do not close the tags ( [ /b ], [ /url ], [ /code ] ). All without the spaces within the [brackets] and see what happens. ;-)
Screenshot: Example
We have did following things:
english.php:
After the line 117 we have inserted the line:
post.php:
After the line 24 we have inserted the line:
After the line 72 we have inserted the lines:
After the line 82 we have inserted the lines:
We have edited line 223:
Finished inserting and editing
Sorry for my ugly english.
Many thx goes to my friend SpinOrg (parse_object.php) etc. from Klammern and many thx to Ts77 for hints and tipps.
Regards, Stoebi
Edited 3 time(s). Last edit at 09/09/2004 09:49AM by Stoebi.
with the newest cvs 'phorum5-cvs-2004090905.tar.gz' comes a hack from a friend of mine.
An archive is attached so you need no manually patch the files post.php and english.php.
1st
Copy post.php to your phorum root and english.php to the ./include/lang/ folder.
2nd
Copy the file parse_object.php to your ./include folder.
That's all.
Try now to post a message with tags like [ b ], [ url ], [ code ] etc. Do not close the tags ( [ /b ], [ /url ], [ /code ] ). All without the spaces within the [brackets] and see what happens. ;-)
Screenshot: Example
We have did following things:
english.php:
After the line 117 we have inserted the line:
"ErrTag" => "Syntax error: there are open tags within your post, please close them:",
post.php:
After the line 24 we have inserted the line:
include_once("./include/parse_object.php");
After the line 72 we have inserted the lines:
// initalize parseText $parseText = new tParseText; $parseText->setText($_POST["body"]); $parseText->tagSearch();
After the line 82 we have inserted the lines:
} elseif ($parseText->tagResult()) { $error = $PHORUM["DATA"]["LANG"]["ErrTag"] . "<br>" . $parseText->getTagResult();
We have edited line 223:
if ($parseText->isTagErr()) { $PHORUM["DATA"]["ERROR"] = ($error); } else { $PHORUM["DATA"]["ERROR"] = htmlspecialchars($error); }
Finished inserting and editing
Sorry for my ugly english.
Many thx goes to my friend SpinOrg (parse_object.php) etc. from Klammern and many thx to Ts77 for hints and tipps.
Regards, Stoebi
Edited 3 time(s). Last edit at 09/09/2004 09:49AM by Stoebi.
Re: Hack: verify open tags September 09, 2004 09:33AM |
Registered: 19 years ago Posts: 60 |
Hi,
i have found a little mistake in post.php.
An empty author field ends in an error.
That is fixed now.
Please use the newest attachment at the end of this message.
Changes in post.php:
I've deleted line 78 and inserted the copied text
before ($parseText = new tParseText;) to line 35
Regards, Stoebi
Edited 1 time(s). Last edit at 09/09/2004 09:41AM by Stoebi.
i have found a little mistake in post.php.
An empty author field ends in an error.
That is fixed now.
Please use the newest attachment at the end of this message.
Changes in post.php:
I've deleted line 78 and inserted the copied text
before ($parseText = new tParseText;) to line 35
Regards, Stoebi
Edited 1 time(s). Last edit at 09/09/2004 09:41AM by Stoebi.
September 10, 2004 02:52PM |
Registered: 19 years ago Posts: 666 |
Re: Hack: verify open tags September 10, 2004 04:04PM |
Registered: 19 years ago Posts: 60 |
September 21, 2004 11:54PM |
Registered: 19 years ago Posts: 666 |
I just downloaded the zip (I haven't had time until now), and tried it out.
Hack advantages:
-doesn't seem to affect performance
-works well detecting open bbcode tags
Hack disadvantages:
-Doesn't detect open bbcode tags if you edit
-Putting in an open html tag, like <b>, gets you the error message:
Fatal error: Call to undefined function: phorum_email_notice() in /home/lyruneda/public_html/boards/post.php on line 187
Edit: Having any html tags, even if closed, gets the error message.
Edit2: I think it's because I'm not running 5.0.10, actually, and I'm running something from 5.0.6 to 5.0.9, because when I used the post.php from the CVSweb, I got about the same error. I went back to a post.php related to the version I'm using, and now everything's find again.
In conclusion(yes?), I think it's a good hack, just meant for 5.0.10. Very awesome, though!
-------------------------------------------
"Everything we see or seem, is but a dream within a dream." -Edgar Allan Poe
Edited 3 time(s). Last edit at 09/22/2004 12:05AM by portal of curiousity.
Hack advantages:
-doesn't seem to affect performance
-works well detecting open bbcode tags
Hack disadvantages:
-Doesn't detect open bbcode tags if you edit
-Putting in an open html tag, like <b>, gets you the error message:
Fatal error: Call to undefined function: phorum_email_notice() in /home/lyruneda/public_html/boards/post.php on line 187
Edit: Having any html tags, even if closed, gets the error message.
Edit2: I think it's because I'm not running 5.0.10, actually, and I'm running something from 5.0.6 to 5.0.9, because when I used the post.php from the CVSweb, I got about the same error. I went back to a post.php related to the version I'm using, and now everything's find again.
In conclusion(yes?), I think it's a good hack, just meant for 5.0.10. Very awesome, though!
-------------------------------------------
"Everything we see or seem, is but a dream within a dream." -Edgar Allan Poe
Edited 3 time(s). Last edit at 09/22/2004 12:05AM by portal of curiousity.
September 22, 2004 10:10PM |
Admin Registered: 22 years ago Posts: 4,495 |
This is obsolete now in Phorum 5.0.10. The bbcode module released in 5.0.10 handles this issue. Just not with an error message.
Brian - Cowboy Ninja Coder - Personal Blog - Twitter
September 23, 2004 01:33PM |
Registered: 19 years ago Posts: 666 |
Re: Hack: verify open tags September 23, 2004 02:03PM |
Registered: 19 years ago Posts: 60 |
September 23, 2004 02:15PM |
Registered: 19 years ago Posts: 666 |
Re: Hack: verify open tags September 23, 2004 08:37PM |
Registered: 19 years ago Posts: 60 |
Sorry, only registered users may post in this forum.