Reply to Tidy removing img and link paths

Your name:

Reply:


Posted by Karl Groves on 09/27/07 20:50

I created a quick function I can call to clean up stuff input into forms
with tidy. The problem I'm having at the moment is that everything within
the 'src' attribute of <img> and within the 'href' attribute of <a> is
being stripped to only "/". So, for example: "<img
src="/images/foo.gif">" is being changed to "<img src="/">"

Any idea what's causing this?

Here's the function. Nothing special, really.


function tidystring($string){
/* here we're going to use Tidy for the additiontal cleanup */
$config = array(
"bare" => true,
"clean" => true,
"doctype" => "omit",
"logical-emphasis" => true,
"quote-ampersand" => true,
"quote-marks" => true,
"quote-nbsp" => true,
"show-body-only" => true,
"word-2000" => true,
"drop-proprietary-attributes" => true,
"drop-font-tags" => true,
"drop-empty-paras" => true,
"hide-comments" => true,
"join-classes" => true,
"join-styles" => true
);

$tidy = new tidy;
$tidy->parseString($string, $config, 'utf8');
$tidy->cleanRepair();
return $tidy;
}

--
Karl Groves

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация