Skip to content

Commit

Permalink
run htmlentities() before putting contents into a file
Browse files Browse the repository at this point in the history
  • Loading branch information
Baylor Rae committed Mar 26, 2012
1 parent a738b5c commit 4ac544f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/gist.php
Expand Up @@ -82,7 +82,7 @@ public function noscript_tag() {
* then display it
*/
if( $this->source !== null ) {
return sprintf('<noscript><pre><code>%s</code></pre></noscript>', htmlentities($this->source));
return sprintf('<noscript><pre><code>%s</code></pre></noscript>', $this->source);
}
}

Expand Down Expand Up @@ -119,6 +119,10 @@ private function download_raw_source() {

// if successful then save it
if( $this->source ) {

// turn into an html ready source before caching
$this->source = htmlentities($this->source);

file_put_contents($this->get_cache_name(), $this->source);
}
}
Expand Down

0 comments on commit 4ac544f

Please sign in to comment.