Home: htmlArea 3 (beta): htmlArea 2 & 3 archive (read only): htmlArea v3.0 - Add-Ons:
Has anyone gotten HTML Tidy to work on IIS?



DarrylB
User

Feb 2, 2005, 7:06 PM


Views: 83721
Has anyone gotten HTML Tidy to work on IIS?

Hey all,

has anyone gotten htmltidy to work on Windows 2000 or Windows 2003? Im having troubles gettign this to work with IIS...

Any help would be appreciated...

Thanks!


whazup
New User

Feb 3, 2005, 10:50 AM


Views: 83683
Re: [DarrylB] Has anyone gotten HTML Tidy to work on IIS?

Yeah, I got it working here. I copied tidy.exe into the same folder as the plugin code, then changed html-tidy-logic.php as follows:


Code
        $source = stripslashes($source); 

// Open a tidy process - I hope it's installed!
$descriptorspec = array(
0 => array("pipe", "r"),
1 => array("pipe", "w"),
- 2 => array("file", "/dev/null", "a")
+ 2 => array("file", "null", "w")
);
- $process = proc_open("tidy -config html-tidy-config.cfg", $descriptorspec, $pipes);
+ $process = proc_open("\"" . getcwd() . "/tidy\"", $descriptorspec, $pipes);
+ // -config html-tidy-config.cfg

// Make sure the program started and we got the hooks...
// Either way, get some source code into $source
@@ -56,7 +57,7 @@

// Create a set of javascript code to compile a new source string
foreach ($srcLines as $line) {
- $jsMakeSrc .= "\tns += '" . str_replace("'","\'",$line) . "\\n';\n";
+ $jsMakeSrc .= "\tns += '" . str_replace("'","\'",trim($line)) . "\\n';\n";
}
?>


I believe that's all I did.

Mark Bradshaw
http://www.dream3.org/

(This post was edited by whazup on Feb 7, 2005, 7:10 AM)


whazup
New User

Feb 3, 2005, 10:51 AM


Views: 83682
Re: [whazup] Has anyone gotten HTML Tidy to work on IIS?

By the way, that's a diff above. You should remove (or comment out) any line that starts with a minus, and add any line that starts with a +.

Mark Bradshaw
http://www.dream3.org/

(This post was edited by whazup on Feb 7, 2005, 7:10 AM)


DarrylB
User

Feb 3, 2005, 6:41 PM


Views: 83656
Re: [whazup] Has anyone gotten HTML Tidy to work on IIS?

Do you know if this requires cmd.exe?

I dont feel comfortable giving IIS access to that file....


whazup
New User

Feb 4, 2005, 4:14 AM


Views: 83634
Re: [DarrylB] Has anyone gotten HTML Tidy to work on IIS?

Not to my knowledge. I'm not 100% sure how proc_open launches processes, but I don't believe cmd.exe is involved.

Mark Bradshaw
http://www.dream3.org/


DarrylB
User

Feb 7, 2005, 6:24 PM


Views: 83577
Re: [whazup] Has anyone gotten HTML Tidy to work on IIS?

Well, i tried to reproduce what you said you did...
No errors, except that proc_open doesnt run.

With research i found out that it does indeed need cmd.exe

Last i heard about cmd.exe being in a position where it can be accessed from by php, is a security issue (very minor, but one none-the-less)...

:(

Anyone know of a replacement?