boardom Forum Index boardom
b2 message board
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

++ bug?

 
Post new topic   Reply to topic    boardom Forum Index -> Bugs
View previous topic :: View next topic  
Author Message
stefan



Joined: 26 May 2003
Posts: 3

PostPosted: Mon May 26, 2003 1:08 pm    Post subject: ++ bug? Reply with quote

my b2 (0.6.1) can't display the plus char... a bug? i found this error while i tried to display some code like:

for(int i = 0; i < 10; i++)

b2 preview this:

for(int i = 0; i < 10; i )

maybee a regex problem here ->
Code:
preg_replace('/\%u([0-9A-F]{4,4})/e',  "'&#'.base_convert('\\1',16,10).';'", $preview_content);


??

err one thing left Smile

when i try to display code like this:

for(int i=0; i<10; i++)

(e.g. no whitespace between i=0)

the '<' char will not replaced with '<' by the regex
Back to top
View user's profile Send private message
stefan



Joined: 26 May 2003
Posts: 3

PostPosted: Fri May 30, 2003 3:13 pm    Post subject: Reply with quote

ok it seems that no one else has this ++ prob.. right?

(btw: the last prob is solved. dont know why it works now)
Back to top
View user's profile Send private message
stefan



Joined: 26 May 2003
Posts: 3

PostPosted: Sun Jun 01, 2003 10:27 pm    Post subject: Reply with quote

hm thanks for your statments here Sad
Back to top
View user's profile Send private message
stevem



Joined: 15 Mar 2003
Posts: 113

PostPosted: Mon Feb 02, 2004 12:03 am    Post subject: + sign vanishes when previewing Reply with quote

OK, I know I am 6 months late but I have just come across this problem myself - maybe someone is interested in the solution Smile

Basically, when previewing an entry, any + is replaced by a space. Changes to the PHP code won't help because by that time it has already happened. It is Javascript that is the culprit. The text of the blog is put in the URL by Javascript where it is then processed by the PHP code; it is the URL that is missing the +.

Solution? Replace + by the alternative code & #43; (without a space after the &). This is done in b2header.php. You need a replace Javascript function, any will do - I used replaceSubstring.

In
Code:
function preview(form)
after the line
Code:
preview_category = escape(preview_category);
add the line
Code:
preview_content = replaceSubstring(preview_content,"+","& #43;");
removing the space after the & (the space is only there to stop it showing on this forum as +).

Then after the final } of function preview(form) add the replaceSubstring function.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    boardom Forum Index -> Bugs All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2 © 2001, 2002 phpBB Group