Firefox PHP

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 03:03PM
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:
"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 03:49PM by Stoebi.
Attachments:
open | download - OpenTagHack.zip (11.9 KB)
Re: Hack: verify open tags
September 09, 2004 03:33PM
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 03:41PM by Stoebi.
Attachments:
open | download - OpenTagHack0.2.zip (11.9 KB)
Re: Hack: verify open tags
September 10, 2004 08:52PM
Is this at all slow or does it not affect performance?

-------------------------------------------

"Everything we see or seem, is but a dream within a dream." -Edgar Allan Poe
Re: Hack: verify open tags
September 10, 2004 10:04PM
Hi,


Phorum 5 is installed on a Pentium 233 Mhz with 64 MB here too for testing etc.

I really can not see any difference. Please try out the hack and give me all you opinion.


Regards, Stoebi
Re: Hack: verify open tags
September 22, 2004 05:54AM
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 06:05AM by portal of curiousity.
Re: Hack: verify open tags
September 23, 2004 04:10AM
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
Re: Hack: verify open tags
September 23, 2004 07:33PM
I guess I'll wait, then. Wasn't planning to download the next Phorum until thread-split/thread-merge and thread split: move a message to be its own thread was up.

-------------------------------------------

"Everything we see or seem, is but a dream within a dream." -Edgar Allan Poe
Re: Hack: verify open tags
September 23, 2004 08:03PM
Hi,

@portal of curiousity

do you want a fixed version of the hack?

If yes, which version or cvs you are using?

Regards, Stoebi



Edited 1 time(s). Last edit at 09/23/2004 08:05PM by Stoebi.
Re: Hack: verify open tags
September 23, 2004 08:15PM
I'd love it. :)

Admin says "version phorum5-cvs-2004082122" if that helps.

-------------------------------------------

"Everything we see or seem, is but a dream within a dream." -Edgar Allan Poe
Re: Hack: verify open tags
September 24, 2004 02:37AM
Hi,

sorry, i can not anymore find your cvs in my archive.
It is possible to send me version directly, please?

mailto:stoebi@gmx.tm


Or do you want we should to apapt this with the latest cvs here?


Regards, Stoebi



Edited 1 time(s). Last edit at 09/24/2004 03:59AM by Stoebi.
Sorry, only registered users may post in this forum.

Click here to login