jooDatabase Forum
Welcome Guest   [Register]  [Login]
 Subject :Re:strpos error in helper file.. 2012-02-01 02:57:13 
Jobsays
Joined: 2012-02-01 01:39:27
Posts: 1
Location

I had this exact problem, found your post and it fixed me right up, thanks Christian Wolkersdorfer!  I just replaced lines 240-253 in joodb.php with your code (JooDB v1.6, Joomla 1.7.3).

Warning: strpos() [function.strpos]: Offset not contained in string in ../components/com_joodb/helpers/joodb.php on line 249

IP Logged
 Subject :strpos error in helper file.. 2010-11-10 21:53:36 
Christian Wolkersdorfer

Guest

joodb 1.5B3 (Joomla 1.5.22) caused an error message in strpos (helper.php) in some situations where the string contained non printable characters. The reason is in function wrapText. Modifying your function to the following version eliminates the bug

/**
* Shorten a text
*
* @access public
* @param String with text, Integer with maximum length
*/
function wrapText($text,$maxlen=120) {
$text = strip_tags($text);
if (strlen($text)>$maxlen) {
$len = strpos($text," ",$maxlen);
if ($len) $text = substr($text,0,$len).' …';
}
return $text;
}

Kind regards und beste Grüße and die Programmierer einer hilfreichen Komponente!

 

Ch Wolkersdorfer

IP Logged
Page # 


Powered by ccBoard