annoying

Author Topic: Faster SMF BBCode Parser v3.0  (Read 3428 times)

dougiefresh

  • Adminstrator
  • Expert Member
  • *****
  • Posts: 261
Faster SMF BBCode Parser v3.0
« on: Sep 07, 2015, 08:42:19 AM »

FASTER SMF PARSER v2.0
By Dougiefresh -> Link to Mod


Introduction
The SMF parser in the SMF 2.0.x line, as well as the SMF 2.1 Beta 1 & 2, have a potentially "fatal flaw", at least where it concerns bbcodes with a large number of parameters.  The original SMF code generates permutations of all possible combinations of the parameters in order to make it easier for the user to use bbcodes, and then checks to see which permutation is the right one.  A bbcode with 14 parameters generates 98,306 permutations, taking little more than half a second on my system PER USE and using 90MB of memory!!  Checking for 15 parameters crashes my forum with an out-of-memory error because it attempts to allocate more than 128MB of memory!

SMF 2.1 Beta 3 takes a different approach to the "fatal flaw", avoiding the use of a permutation array prior to processing the parameter permutations.  This avoids the possible of a forum crash, plus potentially allows for more parameters to be processed without having to rearrange parameters.

Please note that both this mod and SMF 2.1 Beta 3 function in place, as other mods or future forum versions may need the built-in functionality.

Related Discussion
o REPORT: Potentially "Fatal Flaw" in SMF's bbcode parser

Admin Settings
There are no admin settings to this mod.  To disable, you must uninstall this mod.

Compatibility Notes
This mod was tested on SMF 2.0.14, but should work on SMF 2.0 and up.  SMF 1.x is not and will not be supported.

Changelog
The changelog has been removed and can be seen at XPtsp.com.

License
Copy of SMF 2.1 Beta 3's License as copied from the LICENSE file in that install:
Quote
Copyright 2011 Simple Machines. All rights reserved.

Developed by: Simple Machines Forum Project
Simple Machines
http://www.simplemachines.org

All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
  list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
  this list of conditions and the following disclaimer in the documentation
  and/or other materials provided with the distribution.

* Neither the name of SMF2.1 nor the names of its
  contributors may be used to endorse or promote products derived from
  this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
« Last Edit: Jan 09, 2016, 10:18:26 AM by dougiefresh »

dougiefresh

  • Adminstrator
  • Expert Member
  • *****
  • Posts: 261
Re: Faster SMF BBCode Parser v2.0
« Reply #1 on: Sep 07, 2015, 08:46:01 AM »

Downloads


FileName: Faster_SMF_BBCode_Parser_v3.0.zip
Size: 4 kb (3,912 bytes)
MD5: 55bcaa692006bb56b4a5343d6b7287e0
Built: Aug 28, 2017, 12:34:47 PM
Downloaded 74 times

Changelog

Uploaded v3.0 - August 28th, 2017
o Updated mod to use code from SMF 2.1 Beta 3.

Uploaded v2.0 - September 7th, 2015
o Replaced custom code with SMF 2.1 Beta 2 Nightly's code (Sept 4th, 2015)

Uploaded v1.1 - August 19th, 2015
o Modifications made to parse quoted stuff better.

Uploaded v1.0 - July 31st, 2015
o Initial Release to the Public

« Last Edit: Oct 29, 2016, 08:01:27 PM by dougiefresh »