Recent Topics

1 Dec 02, 2005 18:13    

Hello, php newbie here. This is probably a silly question, but whenever I try to post a photo or any other link in b2evo that has a space or a special character in it, it comes back with an invalid URL error. My browser sees it just fine, but b2evo won't. Is there a fix for this or is this just the way it is? My coppermine gallery doesn't have any problems with these urls, and it's in php as well, so I'm a bit confused, plz help :D

2 Dec 02, 2005 21:22

There's an html checker built into b2evolution that tries to keep you from posting any invalid links. It's possible to tweak or disable it in the /conf/_formatting.php file

3 Jan 14, 2006 21:13

It seems the html checker also blocks the escape character %, wich is valid.
If we can't replace spaces by %20, what can we do?

4 Jan 14, 2006 21:58

I just made a test post on my blog that had this link in it:

<a href="http://www.brendoman.com/test.php?text=blah%20blah">test</a>


Works just fine for me. I'm using b2evolution 0.9.1.

5 Jan 14, 2006 23:46

Boble,

It can be frustrating when you're making a post and get the dreaded "invalid URL". Especially if you've included more than one URL ... which one is it that's causing the problem? And why? (Who's blog is it anyway?)

Because of this ... I've made a small hack that you can find [url=http://forums.b2evolution.net/viewtopic.php?t=5291]HERE[/url] (it provides more useful feedback than "Invalid URL" ... you might like it because it should give you more insight as to WHAT is causing a problem. It also provides more feedback if a link is blocked by the blacklist OR if it's an invalid scheme). ;)

As Personman says ... you could always turn OFF the html-checker ... save your post ... then turn it ON again (it's important to have it ON ... so someone can't write some nasty script in your comments and toast your DB. So if you choose to do this ... don't forget to turn it back on!

To turn it off ... edit /conf/_formatting.php and set the switch "$use_html_checker" from 1 (use it) to 0 (don't use it).

Hope this helps.

-stk :D

6 Jan 15, 2006 18:19

I get this only with the 1.6-Alpha version. I didn't get it before.

for example, this url will be invalid:
<a href="http://organigramme.net/this%20test.html">test</a>

but this one works
<a href="http://organigramme.net/thistest.html">test</a>

As for your hack, the file dosen't exist on 1.6, or is located elsewhere. any hints?

7 Jan 15, 2006 19:34

Boble, find the function validate_url() in /evocore/_misc.funcs.php and replace the if-preg_match-block that looks similar to the one below with the one below:


if( ! preg_match('~^                # start
		([a-z][a-z0-9+.\-]*):[0-9]*       # scheme
		//                                # authority absolute URLs only
		[a-z0-9]([a-z0-9\~+.\-_,:;/\\\\*=]|(%\d+))* # Don t allow anything too funky like entities
		([?#][a-z0-9\~+.\-_,:;/\\\\%&=!?#*\ \[\]]*)?
		$~ix', $url, $matches) )
	{ // Cannot validate URL structure
		$Debuglog->add( 'URL &laquo;'.$url.';&raquo; does not match url pattern!', 'error' );
		return T_('Invalid URL');
	}

8 Jan 15, 2006 20:44

Boble,

Wasn't aware you were running Phoenix Alpha v1.6. The hack is slightly different for this newer version and tho I tested it I haven't added it to my production version yet.

Let me know if you want it and I'll post it for you. (Note to self ... need to add v1.6 hack)

-stk :D


Form is loading...