473,473 Members | 1,844 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Tidy removing img and link paths



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 <imgand within the 'href' attribute of <ais
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

Sep 27 '07 #1
0 1132

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

26
by: Tobias Wendorff | last post by:
Hi there, could anybody please do me a big favour and compile the latest sourcecode of HTML Tidy (DLL and EXE)? http://tidy.sourceforge.net/src/tidy_src.tgz Visual C++ files are in...
13
by: J. J. Cale | last post by:
I have the following. There must be something less cumbersome without push pop. The function parameter obj is the event.srcElement and has the attributes(properties?) picNum and alb pinned to it....
12
by: Stefan Weiss | last post by:
Hi. (this is somewhat similar to yesterday's thread about empty links) I noticed that Tidy issues warnings whenever it encounters empty tags, and strips those tags if cleanup was requested....
6
by: Ozz | last post by:
Hi there, I have a link on my web page. When clicked, opens up a pdf file that is stored on my server. Every file is specific to a user's user name and I don't want users to see each other's...
2
by: SR | last post by:
I have started a web site using ASP.NET 2.0. I would like to centralize all of my classes in a StyleSheet but I cannot figure out how to link the StyleSheet to a Content Page since there is no...
27
by: Robert Hicks | last post by:
I want to upgrade to 2.5 but I don't see any unistall instructions anywhere. Robert
7
by: Academia | last post by:
I have a 2004 version of HTML Tidy for windows. I tried to find out if there is a new version of it and went to Source Forge but couldn't figure out that site. Do you know if there is a newer...
6
by: Olagato | last post by:
I need to transform this: <urlset xmlns="http://www.google.com/schemas/sitemap/0.84"> <url> <loc>http://localhost/index.php/index./Paths-for-the-extreme-player</ loc> </url> <url>...
0
by: kempshall | last post by:
Can somebody please tell me how to install the Tidy module for PHP 5 on a Mac? I tried what the php.net website said, which is running the command "pecl install tidy" but the installation failed...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.