Fix for BBCode bug when legitimate ',%()' in url
Posted: Fri Apr 28, 2006 7:21 pm
Fix for BBCode bug when legitimate ',%()' in url
DOWNLOAD THE PATCH FROM http://blog.lege.net/serendipity_event_ ... .patch.txt - DON'T try to cut-paste!http://blog.lege.net/serendipity_event_bbcode.php.patch.txt wrote: THIS IS http://blog.lege.net/serendipity_event_ ... .patch.txt
A PATCH FOR UP TO AT LEAST serendipity-0.9.1 (still latest stable
as of April 28, 2006) THAT MAKES THE BBCode PLUGIN ACCEPT MORE
COMMONLY USED URL's WITH THE url= TAG. IT DIDN'T ACCEPT ',%()'
IN URL:s AND MANY OF THE SITES I COMMONLY WISH TO LINK TO USE THESE
CHARACTERS IN THE URL-NAMES! HENCE THIS PATCH:
* Save this file as serendipity_event_bbcode.php.patch
* Copy this file to the root of your Serendipity installation
* Execute:
cp -p plugins/serendipity_event_bbcode/serendipity_event_bbcode.php \
plugins/serendipity_event_bbcode/serendipity_event_bbcode.php-the_old_version
patch -p0 < serendipity_event_bbcode.php.patch
* THAT'S ALL - IT ALREADY WORKS! VISIT THE FILES AND SEE THE CHANGES, ETC:
cd plugins/serendipity_event_bbcode
diff serendipity_event_bbcode.php-the_old_version \
serendipity_event_bbcode.php
*** plugins/serendipity_event_bbcode/serendipity_event_bbcode.php~ Sun Oct 2 23:47:56 2005
--- plugins/serendipity_event_bbcode/serendipity_event_bbcode.php Fri Apr 28 18:37:34 2006
*************** class serendipity_event_bbcode extends s
*** 150,157 ****
// Only allow strings occuring in emails: .-_@, 0-9, a-z
static $pattern_mail = '([\.\-\+~@_0-9a-z]+?)';
! // Only allow strings occuring in URLs: &;?:.-_@/, 0-9, a-z
! static $pattern_url = '([@!=~\?:&;0-9a-z#\.\-_\/]+?)';
// Disallow possibly evil HTML characters which may lead to Javascript XSS: '"();
static $pattern_query = '([^"\'\(\);]+?)';
--- 150,157 ----
// Only allow strings occuring in emails: .-_@, 0-9, a-z
static $pattern_mail = '([\.\-\+~@_0-9a-z]+?)';
! // Only allow strings occuring in URLs: &;?:.-_@/,%(), 0-9, a-z
! static $pattern_url = '([@!=~\?:&;0-9a-z#\.\-_\/,%\(\)]+?)';
// Disallow possibly evil HTML characters which may lead to Javascript XSS: '"();
static $pattern_query = '([^"\'\(\);]+?)';