PDA

View Full Version : BB Code Enhancements - Validate matching quote BBCode tags.


raywjohnson
05-14-2009, 10:00 PM
Quotes Validation

I created this modification to help alleviate the need to edit posts that have invalid/mismatched QUOTE tags. For a busy forum, correcting bad QUOTE tags can become a big problem for your moderators.

Messages (new or edited) rejected by this mod will return the member to the post submission form with the phrase: "One or more of [quote] tags are missing or mismatched. All posts are required to have proper matching quotes."

I have been running it on my board for a month or so without problems. It may run on versions older then 3.8, but I have not tested that.

I have created a number of mods for my board, this is the first one I have released!

--RayJ

NOTE: Plugin works on vBulletin version 4

Description
Check new and edited posts for valid/matching open and close [quote] BBCode tags.
*Should* work with any number of nested or included quote tags.

Details
1 Product XML with 3 Plugins, 2 Phrases, 5 Settings, and 0 Queries
1 File/Class
No template modifications.

Files
class_verifyquotes.php
install.txt
license.txt
license-vqbc_rayj2009.txt
v1.3 = product-vqbc_rayj2009_1-3.xml
v1.2 = product-vqbc_rayj2009_1-2.xml
v1.1 = product-vqbc_rayj2009_1-1.xml
v1.0 = product-vqbc_rayj2009.xml

Upgrading
v1.0-v1.1 :
Upload class_verifyquotes.php file to the /includes/ directory
import product-vqbc_rayj2009_v1-1.xml (Allow Overwrite)
v1.(0/1)-v1.2 :
Upload class_verifyquotes.php file to the /includes/ directory
import product-vqbc_rayj2009_v1-2.xml (Allow Overwrite)
v1.(0/1/2)-v1.3 :
Upload class_verifyquotes.php file to the /includes/ directory
import product-vqbc_rayj2009_v1-3.xml (Allow Overwrite)

History
1.0
Initial Version
1.1
Added plugin: newpost_preview
Added setting: Auto Preview Mode.
If active, the system will automatically put you in preview mode, and display the error message in the post area, when QUOTE mismatches are found.
Added phrase: To display CSS around "in post" error message.
Bug Fix: versions v1.0 and v1.1 (Note: fix already applied to all versions)
Memory leak causes download dialog for all browsers (for large posts). Download quotes_validation_bugfix.zip (contains: class_verifyquotes.php) and upload it. Fixes all previously installed versions.
1.2
Added Option: Style (CSS) for error message
Added Option: Bad Quotes Error Message
This will let you edit the Error Message and CSS that controls the output without having to edit the phrase directly. I left the original phrase code in place so that it will not get wiped out when you upgrade. You will have to search for the phrase (vqbc_bad_quotes_error) and copy it to the new setting.
Changed the phrase that displays the "in post" error message to work with the new options.
1.3
Bug Fix: Removed recursion and complex regular expressions. These were causing issues with large posts.
Added Option: Ignored Tags (allows you to add tags to be ignored during validation, note: noparse is always ignored)

Notes
PHP 5.0+ required.
If you are still using PHP 4 (you should upgrade). Or you can edit the class_verifyquotes.php file and remove all public and private keywords (before each function). Then edit the product-vqbc_rayj2009_v1-1.xml file and remove the PHP 5.0 dependency line.

raywjohnson
05-14-2009, 10:03 PM
My first mod release.

Enjoy!

--RayJ

Sofia
05-14-2009, 11:11 PM
Yeah ! Not bad.

I will test it later. Thank you for this mod. ;)

meissenation
05-15-2009, 11:59 AM
Great idea! I'm always fixing mismatched quotes. Thanks!

Leo Brazil
05-15-2009, 02:17 PM
Good idea, I'm tagging this to test it in a few days.

Thanks.

Tim Skellett
05-15-2009, 02:30 PM
A great idea, many thanks, RayJ!

vithorius
05-16-2009, 11:41 AM
Great, great, GREAT idea!!!

Thank you so very much.

Supramania
05-16-2009, 04:28 PM
I get:

Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /path/to/forums/includes/class_verifyquotes.php on line 35

When it's active. Any ideas?

raywjohnson
05-16-2009, 08:37 PM
I get:

Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /path/to/forums/includes/class_verifyquotes.php on line 35

When it's active. Any ideas?Yes! Are you running PHP version 4?

If so, open the file /includes/class_verifyquotes.php and remove the "public" and "private" before both function keywords.

--RayJ

Supramania
05-16-2009, 09:08 PM
Yes PHP 4.4.6 (cli)

That fixed it - works great now! :D

Black Tiger
05-17-2009, 01:14 PM
Great mod, going to install this one, thank you!

Mark.B
05-17-2009, 01:37 PM
Works great...

I do find on Quick reply it just takes you to a preview of the post if there's a mismatch, I think it could do with an error message here like on the full reply so people know what's wrong.

raywjohnson
05-17-2009, 08:11 PM
Works great...

I do find on Quick reply it just takes you to a preview of the post if there's a mismatch, I think it could do with an error message here like on the full reply so people know what's wrong.I tried to do this. But after several attempts, I could not get an acceptable system in place. The Quick reply is AJAX based and I need to take the time to learn how it works in vB. I may try to get the done at some point.

--RayJ

TCB
05-23-2009, 01:09 PM
sounds handy. Thanks :D

lm3a.net
05-24-2009, 04:38 AM
good mod

thanks,

raywjohnson
05-24-2009, 11:49 PM
Greetings All!

You are most welcome!

A number of users on my forum requested that this modification automatically put you in the Preview mode when it finds mismatched quotes. After a bit of effort, I found a way to make it work.

I decided that some might like the original functionality, so I made this change an option in the AdminCP.

Enjoy!

--RayJ

Wseries
03-19-2011, 06:03 AM
I had this installed on vBulletin 3.8 and it was great. Does anyone know if it will work with vBulletin 4?

raywjohnson
03-19-2011, 08:07 PM
It may. I am not sure. I will do some testing and let you know. If it does not work, I will update it so that it will.

--RayJ

raywjohnson
03-19-2011, 08:17 PM
Alrighty then!

I installed it on vB v4.0.8 and it worked as expected.

:D

--RayJ

BirdOPrey5
03-27-2011, 06:30 PM
Looks cool... has the bug-fix been put into version 1.1 yet or we still need to download both?

Thanks :up:

raywjohnson
03-27-2011, 08:35 PM
The bug fix has already been applied to both versions. So you only have to download the latest!

And... there is a new version (1.2) that added the ability to change the error message, and the CSS that controls its display, via the options.

--RayJ

BirdOPrey5
03-27-2011, 09:48 PM
Nice update, thanks. :)

If anyone is interested I'm using this CSS to make a rounded border with a slight shadow, light yellow background and dark red text... Easily edited to your needs.

There are 3 properties needed for each rounded border (radius) and shadow... -moz is for firefox browser, -webkit is for chrome browser, and the other is for IE9 and standard web browsers.

color: darkred; background: lightyellow; border: 2px inset red; padding: 4px; margin: 2px; -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; moz-box-shadow:0 0 2px darkred; -webkit-box-shadow:0 0 2px darkred; box-shadow:0 0 2px darkred;

ravenscape
12-03-2011, 04:48 PM
This is a great modification, but people occasionally will have a problem with it on our site due to the length (number of characters) of the quoted text. The limit within one set of quote tags appears to be 8281. I can add another set of quote tags around a 8281 character quote and add some more text in the outer set.

raywjohnson
12-04-2011, 01:31 AM
Are you using the latest version? There was an issue with large posts in the original version.

--RayJ

ravenscape
12-04-2011, 05:11 AM
it is version 1.2 that I have installed.

xorex
12-04-2011, 07:28 AM
will be good if mod would have setting for exclude validate quotes inside tags

example: [code] [html] [php] e.t.c

raywjohnson
12-04-2011, 08:56 PM
it is version 1.2 that I have installed.I will check that out and see what is causing the problem!

will be good if mod would have setting for exclude validate quotes inside tags

example: [code] [html] [php] e.t.cI will try to implement that.


--RayJ

raywjohnson
12-05-2011, 12:11 AM
This is a great modification, but people occasionally will have a problem with it on our site due to the length (number of characters) of the quoted text. The limit within one set of quote tags appears to be 8281. I can add another set of quote tags around a 8281 character quote and add some more text in the outer set.

I have looked over the code and tested various amounts of data. I posted over 16000 characters in QUOTED text, with and without proper QUOTE tags. Everything worked as expected.

Could you do me a favor? Check your forums "Maximum Characters Per Post" setting. That may be what is causing this issue. The setting is in Message Posting and Editing Options.

--RayJ

ravenscape
12-05-2011, 12:47 AM
I have looked over the code and tested various amounts of data. I posted over 16000 characters in QUOTED text, with and without proper QUOTE tags. Everything worked as expected.

Could you do me a favor? Check your forums "Maximum Characters Per Post" setting. That may be what is causing this issue. The setting is in Message Posting and Editing Options.

--RayJ


The max characters setting is at 50,000.

This is the maximum amount that I can post in a single quote.


Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam tristique posuere elit, vitae iaculis ipsum suscipit adipiscing. Aliquam ultricies tortor at nulla vehicula mollis. Aliquam euismod tristique est, laoreet feugiat nisi ornare ut. Vestibulum sodales magna non erat dictum eget vehicula sapien viverra. Proin eget sem eget mi sodales aliquam a eu nisi. Ut imperdiet pulvinar gravida. Praesent eu placerat ipsum. Nunc cursus, lorem sed tempor sollicitudin, erat odio consequat mauris, sed ornare magna risus nec ante. Vestibulum eget lectus vel felis dignissim volutpat vitae a arcu. Proin orci ante, ultricies at convallis in, fermentum sed justo. Nullam dignissim risus vitae lorem luctus pellentesque. Suspendisse eu nibh id orci rutrum porttitor. Quisque pellentesque purus quis felis dignissim aliquet. Cras dictum pellentesque ipsum eget sollicitudin. Duis scelerisque justo id sapien sollicitudin eu facilisis lectus dapibus. Nunc turpis lorem, hendrerit et auctor nec, fringilla vel mi.

Duis arcu risus, interdum et venenatis vehicula, vehicula nec nibh. In sagittis, nibh non mattis adipiscing, mauris enim mollis elit, eu euismod justo dui sit amet erat. Ut at tellus massa, vitae accumsan orci. Vivamus leo ligula, blandit malesuada cursus nec, aliquam in lectus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Integer ante ligula, lacinia a elementum nec, ultrices eu purus. Phasellus sed velit metus, ac ultrices felis. Nam vehicula sapien in magna porta vulputate quis vel justo. Mauris dignissim imperdiet enim, in placerat felis scelerisque eget. Nullam placerat dignissim fringilla. Nullam massa leo, luctus non adipiscing nec, iaculis vitae eros. Maecenas vitae magna vitae velit tincidunt gravida sit amet sed sem. Fusce pulvinar libero ac lorem congue quis porta sapien gravida. Cras volutpat elementum risus, a imperdiet tellus ullamcorper fringilla. Sed ultrices libero ut sapien tincidunt fringilla.

Aliquam imperdiet augue aliquam lacus lacinia id porttitor nibh dapibus. Vivamus at justo lorem, ac mattis magna. Donec tempor accumsan quam, eget volutpat ante commodo at. Donec lacinia dictum odio. Fusce suscipit gravida lorem, eget feugiat lacus posuere eget. Integer eget felis nisi. Phasellus urna purus, egestas at porttitor nec, ullamcorper pharetra magna. Aenean quis porta turpis. Nulla eget augue et ante placerat viverra. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Donec vel metus sit amet mi vehicula egestas. Mauris dignissim consectetur ultricies. Integer condimentum elementum nisi, nec congue sem bibendum ut. Nunc ac sem non sapien porttitor ultricies.

Vivamus varius facilisis magna id interdum. Morbi facilisis risus in odio ullamcorper sodales. Mauris suscipit ipsum vitae dolor ullamcorper sed tempus risus rhoncus. Cras elementum placerat porta. Donec molestie vehicula egestas. Sed luctus justo quis magna porta non semper nibh dictum. Duis nec nunc magna, ut porta neque. Ut felis nunc, porttitor ut fringilla non, viverra sit amet nunc. Fusce at quam nec nisi semper tristique id ac est. Sed blandit tellus quis lectus feugiat egestas. Suspendisse vitae est vitae tortor volutpat luctus. Nunc bibendum consequat nibh, non adipiscing turpis ultricies ac. Integer elementum arcu nec mauris imperdiet consequat. Pellentesque a quam dolor. Morbi sit amet augue quis mi adipiscing scelerisque.

Maecenas elementum vestibulum vehicula. Nunc nulla eros, gravida vel cursus cursus, porta non magna. Etiam vehicula erat congue eros mollis quis tristique mi tempus. Maecenas at purus hendrerit lorem porttitor ornare id at nisl. Donec placerat justo sed ipsum faucibus iaculis. Proin id diam nec purus suscipit placerat. Pellentesque vitae justo odio, id ullamcorper mi. Donec sed dui sapien, quis gravida velit. Nullam vestibulum semper dolor, ac tincidunt elit consequat eu. Proin pharetra volutpat enim non condimentum. Etiam et fermentum lorem. Proin ornare ligula a ante lacinia tempus.

Morbi bibendum, risus id mattis suscipit, augue libero rutrum mauris, eu pretium dolor lacus non mauris. Vestibulum lobortis erat id diam commodo interdum. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Donec posuere ultricies nisl, eget adipiscing lectus sodales id. Mauris pharetra, quam eu facilisis iaculis, odio magna laoreet magna, non malesuada massa nisi vitae nisl. In hac habitasse platea dictumst. In in purus nulla. Morbi ligula risus, hendrerit sed pretium quis, viverra et nulla. Donec ultrices, arcu eget feugiat rutrum, arcu urna egestas justo, non sollicitudin orci felis at nulla. Suspendisse aliquam est eu turpis ultricies pharetra. Curabitur facilisis convallis orci, nec sodales turpis condimentum vel. Phasellus augue elit, volutpat tincidunt sollicitudin vel, faucibus nec massa.

Nam a nibh viverra nisi venenatis vehicula non eu arcu. Nunc neque neque, blandit tincidunt eleifend sed, luctus nec metus. Aliquam non urna sem. Nulla facilisi. In dui nulla, malesuada at condimentum et, consectetur in urna. Phasellus bibendum, tellus gravida vestibulum volutpat, lorem arcu consectetur lorem, eget accumsan nunc massa in arcu. Quisque eu lacus et sapien malesuada vulputate. Nunc nunc quam, volutpat quis tempor a, eleifend vel erat. Morbi sit amet magna a felis ultricies accumsan. Duis ullamcorper ipsum eget dui rutrum aliquet. In in massa purus. Nunc molestie tempor risus. Aenean venenatis fringilla adipiscing.

Sed felis arcu, fermentum et gravida sit amet, blandit pretium metus. Praesent at eros ac augue tincidunt interdum. Donec a mattis eros. Aliquam lobortis, turpis eget mattis dapibus, nulla purus venenatis erat, sed congue tortor nisl ut enim. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Cras vulputate felis et mauris scelerisque auctor. Sed sed imperdiet eros. Vivamus pulvinar consectetur ipsum sit amet pellentesque. Curabitur vitae massa massa, vel porta velit. Etiam consequat quam vitae augue blandit tempus. Vestibulum laoreet suscipit tortor sit amet ultrices.

Donec a lorem ut sapien vulputate ultrices et ac odio. In ut elit sed est ullamcorper sodales eu ultrices enim. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque dui ipsum, placerat sit amet hendrerit at, ullamcorper ac elit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Curabitur a nisl nisl, sit amet convallis erat. Nunc ultricies ante sed nulla egestas scelerisque. Duis sed mauris eros. Donec tincidunt condimentum nisl, non aliquam augue sodales vitae. Pellentesque sit amet lorem vel lacus condimentum bibendum.

Praesent placerat tincidunt pharetra. Nam egestas, est rhoncus pharetra sodales, erat nisl euismod enim, non tempus velit elit at lacus. Aliquam erat volutpat. Fusce auctor varius ullamcorper. Suspendisse potenti. In a arcu id orci viverra rhoncus. In sit amet tellus id lacus porta bibendum nec quis ante. Aliquam ultrices quam eu eros consequat ut fermentum felis laoreet. Curabitur ullamcorper libero orci. Sed dignissim nunc a lectus posuere lobortis. Aliquam auctor enim ac neque pellentesque vulputate. Aliquam erat volutpat. Praesent pulvinar nunc volutpat urna dictum tincidunt. Nunc lectus erat, laoreet vitae vehicula a, facilisis eu sapien. Phasellus elementum aliquet sapien.

Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Aliquam euismod sem ac lorem sollicitudin tincidunt. Quisque vehicula neque vitae nisl cursus vitae iaculis nulla malesuada. Nulla urna augue, sodales vel viverra in, sagittis nec nulla. Maecenas lorem elit, pretium sed aliquet nec, pharetra a dolor. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nunc vel cursus nisi. Curabitur aliquet, libero ut tempus malesuada, eros nisi cursus tellus, scelerisque semper quam turpis a turpis. Quisque ut metus augue. Maecenas fringilla, nulla quis fringilla commodo, quam justo ornare eros, quis ultrices tellus tortor sed tellus. Pellentesque in mattis tellus. Sed at sagittis odio. Nam et nisl lacus. Fusce imperdiet lacus dui, id s

I can post that in a nested quote with more text in the outer quote, so I don't think it's the max characters per post that's gonked. If I turn off the mod, then the posts we're having trouble with go through fine.

raywjohnson
12-05-2011, 01:08 AM
The max characters setting is at 50,000.

This is the maximum amount that I can post in a single quote.



I can post that in a nested quote with more text in the outer quote, so I don't think it's the max characters per post that's gonked. If I turn off the mod, then the posts we're having trouble with go through fine.Excellent. The next thing to check is the /includes/class_verifyquotes.php file. Specifically the Parse function. It should look like this:

public function Parse($text) {

$text = preg_replace('#\[quote.*?\]#i','[quote]',$text);
$text = preg_replace('#\[quote\]\[\/quote\]#i','',$text);
$text = preg_replace('#\[noparse\].*?\[\/noparse\]#si','',$text);

$text = $this->do_parse($text);
return preg_match('/\[quote.*?\]|\[\/quote\]/si',$text);
}


if not, then you are still using the original buggy version.

--RayJ

raywjohnson
12-05-2011, 01:22 AM
will be good if mod would have setting for exclude validate quotes inside tags

example: [code] [html] [php] e.t.c

I tested some code changes that would allow for this. It will work, but you will introduce a huge problem that this product was designed to defeat. Wild looking posts. Here is an example:

--------START

THIS:

TestNest #1Nest #2[QUOTE ]Nest #3[/QUOTE ]
[QUOTE ]in No Parse[/QUOTE ]
[code ][QUOTE]in Code [/code ]
[php ][QUOTE]in PHP[/php ]
[/QUOTE ][/QUOTE ][/QUOTE ]

RENDERS AS THIS:

Test[QUOTE]Nest #1[QUOTE]Nest #2[QUOTE]Nest #3
[QUOTE]in No Parse
in Code
[QUOTE]in PHP


--------END

What is going wrong here? This product would tell you that the issue was mismatched quote tags. If you set it up to NOT detect this within PHP and CODE tags, then you might as well not use it at all.

--RayJ

Max Taxable
12-05-2011, 01:37 AM
Installed, tested, works like a charm. Great Mod, thanks!

ravenscape
12-05-2011, 01:58 AM
It looked the same, except for a comment. I replaced the code and saved the file anyway in case I missed something.

On testing, it still doesn't work.

No data received
Unable to load the webpage because the server sent no data.
Here are some suggestions:
Reload this webpage later.
Error 324 (net::ERR_EMPTY_RESPONSE): The server closed the connection without sending any data.

raywjohnson
12-05-2011, 03:05 AM
It looked the same, except for a comment. I replaced the code and saved the file anyway in case I missed something.

On testing, it still doesn't work.

Oops! I just gave you the Parse function, here is the entire code (with remarks):

/**
* Quotes Validation Class
*
* @product vqbc_rayj2009
*
*/
class vqbc_VerifyQuotes {

/**
* Parses the post message.
*
* @param string text to be validated for matching quote tags
*/
public function Parse($text) { //returns TRUE if bad quote found

$text = preg_replace('#\[quote.*?\]#i','[quote]',$text);
$text = preg_replace('#\[quote\]\[\/quote\]#i','',$text);
$text = preg_replace('#\[noparse\].*?\[\/noparse\]#si','',$text);

$text = $this->do_parse($text);
return preg_match('/\[quote.*?\]|\[\/quote\]/si',$text);
}

/**
* sub-parsing function
*
* @param string (internal call only)
*/
private function do_parse($text) {
if(is_array($text)) { $text = $text[1]; }
$regex = '#\[quote\]((?:[^[]|\[(?!/?quote\])|(?R))+)\[/quote\]#i';
return preg_replace_callback($regex,array($this,'do_parse '),$text);
}
}


--RayJ

ravenscape
12-05-2011, 03:10 AM
still doesn't work.

I'll reinstall from scratch tomorrow and see if it clears up.

raywjohnson
12-05-2011, 04:09 AM
still doesn't work.

I'll reinstall from scratch tomorrow and see if it clears up.

Ok.

Also, what exactly does the system tell you when you have a quote with more than 8281 characters?

--RayJ

Joe Blow
09-16-2013, 06:11 PM
I have had to disable this plugin for 4.x.x as it has been causing problems for those trying to post long posts in quote tags. My host narrowed it down to this plugin and sure enough, as soon as it was disabled all the posting issues went away.

A shame, as it is a useful plugin. Just doesn't seem to work.

Max Taxable
09-16-2013, 07:50 PM
I have had to disable this plugin for 4.x.x as it has been causing problems for those trying to post long posts in quote tags. My host narrowed it down to this plugin and sure enough, as soon as it was disabled all the posting issues went away.

A shame, as it is a useful plugin. Just doesn't seem to work.It's a plugin for v3.8.x which might need some tweaking to be truly compatible with version 4.

raywjohnson
09-16-2013, 10:42 PM
I have had to disable this plugin for 4.x.x as it has been causing problems for those trying to post long posts in quote tags. My host narrowed it down to this plugin and sure enough, as soon as it was disabled all the posting issues went away.

A shame, as it is a useful plugin. Just doesn't seem to work.If you could tell me what exactly it is doing, I could work on a fix. Did you get any errors in the php error log? Any errors or other output in the browser?

It's a plugin for v3.8.x which might need some tweaking to be truly compatible with version 4.

True. Thanks. I will to some testing on version 4 to see what I can find out.

--RayJ

Joe Blow
09-17-2013, 05:52 PM
If you could tell me what exactly it is doing, I could work on a fix. Did you get any errors in the php error log? Any errors or other output in the browser?



True. Thanks. I will to some testing on version 4 to see what I can find out.

--RayJ

I am waiting on my host to respond to my request for additional info. In the meantime, you can take a look at this thread I started on vbulletin.com. The issue that I started the thread about was being caused by this plugin.

http://www.vbulletin.com/forum/forum/vbulletin-4/vbulletin-4-questions-problems-and-troubleshooting/413670-long-quote-long-post-error

This is what the host said in an email to me when this plugin was finally identified as the issue:

Hey Joe, the class_verifyquotes.php plugin appears to be the culprit.
Are you able to disable that and confirm if it fixes it? I tried to
just rename the file but it's still getting called and giving a blank
page. While slightly better than a crash, i think disabling it or
updating that plugin ought to fix the problem.

Hope that helps.

Max Taxable
09-17-2013, 07:27 PM
True. Thanks. I will to some testing on version 4 to see what I can find out.

--RayJYes I was merely pointing out in a subtle way, that to expect a add-on that is coded for version 3.8, to work without flaw on a version 4 installation, is not reasonable.:D

Joe Blow
09-17-2013, 07:48 PM
Further info:

It was core dumping with with signal 4 when one of the regexp functions was called on the string.

raywjohnson
09-17-2013, 08:01 PM
Further info:It was core dumping with with signal 4 when one of the regexp functions was called on the string.


Yep. I found the same problem while testing. I will be working on a fix today.

The issue is that due to the recursion, it runs out of memory when crunching through large posts. I thought I had a fix for that already, but simply failed to take into account text before and after any quoted text. So a 5k post with 10 nested quotes causes 10 PHP recursive calls. The regex is also recursive!

I have re conceptualized the functionality and may have come up with a fast and efficient solution.

I hope to upload the newest version later today.

--RayJ

raywjohnson
09-17-2013, 11:18 PM
Alrighty then!

Found a good solution. Version 3 does not use recursion at all. I also added an extra check to make sure the class file (class_verifyquotes.php) exists. So if the file gets deleted or renamed, your board will not go down (i.e. show a blank page).

I also added the ability to remove tags (other than just "noparse") prior to validation.

I tested it in VB4 and it worked fine.

Everyone should upgrade to version 3 of this plugin.

Standing by for bug reports! ;)

--RayJ

ozzy47
09-17-2013, 11:25 PM
Alrighty then!

Found a good solution. Version 3 does not use recursion at all. I also added an extra check to make sure the class file (class_verifyquotes.php) exists. So if the file gets deleted or renamed, your board will not go down (i.e. show a blank page).

I also added the ability to remove tags (other than just "noparse") prior to validation.

I tested it in VB4 and it worked fine.

Everyone should upgrade to version 3 of this plugin.

Standing by for bug reports! ;)

--RayJ

Just to be clear, this will still work in 3.8.x series? Not that I use this, just so the people that do know.

raywjohnson
09-17-2013, 11:37 PM
Just to be clear, this will still work in 3.8.x series? Not that I use this, just so the people that do know.

Yes. Thanks for reminding me. It is still developed on and for VB3.8.

--RayJ

Black Tiger
10-26-2013, 11:12 PM
Sorry but I've got a problem on 3.8.7 with 1.3 so I think it's buggy, because this problem does not occur with version 1.2.

I've got vbulletin 3.8.7 pl3 running. When I use version 1.3 and try to make a new post, I don't get the in between lines saying that my thread is being posted, but I just get a white screen, nothing more.

When I use version 1.2 the problem is gone and I can post again.

How can this be fixed?

raywjohnson
10-26-2013, 11:41 PM
When you upgraded to 1.3, did you upload the class_verifyquotes.php file to the /includes/ directory? Each version must use its own class_verifyquotes.php file.

--RayJ

Black Tiger
10-27-2013, 12:03 AM
No I didn't because it said:
v1.(0/1/2)-v1.3 : just import product-vqbc_rayj2009_v1-3.xml (Allow Overwrite)
So I thought that was not necessary.

Thank you for the quick support, I'm going to change it now!

raywjohnson
10-27-2013, 12:13 AM
No worries. And thank you for the feedback. I will fix the instructions!

-RayJ

Black Tiger
10-27-2013, 12:28 AM
You're welcome.
And for your information... it's working now indeed. Thank you!

raywjohnson
10-27-2013, 12:59 AM
Excellent! :D