jooDatabase Forum
Welcome Guest   [Register]  [Login]
 Subject :Re:Web addresses not handled right..... 2011-08-19 00:06:51 
Fred

Guest

There is a problem with the php code. I got it the other way:

DB entry was http://www.example.com

When a user then clicks on it the browser it comes up with an error, cause the link will be:

http://http://www.example.com

Also when you hover over the link it shows the double http://http://

 

Update the code in helpers/joodb.php

 

from:

if ($params->get('link_urls')) {
                    // try to detect and link urls and emails
                    if (preg_match('/^[^@]+@[a-zA-Z0-9._-]+\.[a-zA-Z]+$/', $field)) {
                        $field= JHtml::_('email.cloak', $field);
                    } else if (strtolower(substr($field,0,4))=="www.") {
                        $field= '<a href="http://'.$field.'" target"_blank">'.$field.'</a>';
                    } else if (strtolower(substr($field,0,4))=="http") {
                        $field= '<a href="http://'.$field.'" target"_blank">'.$field.'</a>';

 

to

 

if ($params->get('link_urls')) {
                    // try to detect and link urls and emails
                    if (preg_match('/^[^@]+@[a-zA-Z0-9._-]+\.[a-zA-Z]+$/', $field)) {
                        $field= JHtml::_('email.cloak', $field);
                    } else if (strtolower(substr($field,0,4))=="www.") {
                        $field= '<a href="http://'.$field.'" target"_blank">'.$field.'</a>';
                    } else if (strtolower(substr($field,0,4))=="http") {
                        $field= '<a href="'.$field.'" target"_blank">'.$field.'</a>';

 

And it should work

 

 

 

IP Logged
 Subject :Web addresses not handled right..... 2011-04-08 18:28:05 
ethonbridges
Joined: 2011-04-04 22:50:00
Posts: 6
Location

I have a database with members website addresses as one of the fields.

 

When joodb displays it, it displays it as it shows in the database.  But, when you roll over it with the mouse, the link it shows is "http//www.something.com" without the ":" (colon).  This causes the link to fail because it's not properly formed.

So, database has:

http://www.something.com

joodb created URL shows:

 

http//www.something.com

 

Could this really have been overlooked for this long?

IP Logged
Page # 


Powered by ccBoard