Ticket #1827: rev-5940-htmlentities.patch
| File rev-5940-htmlentities.patch, 3.2 kB (added by Pavel.Treutner, 1 year ago) |
|---|
-
lib/controller/sfWebController.class.php
old new 216 216 $response->clearHttpHeaders(); 217 217 $response->setStatusCode($statusCode); 218 218 $response->setHttpHeader('Location', $url); 219 $response->setContent(sprintf('<html><head><meta http-equiv="refresh" content="%d;url=%s"/></head></html>', $delay, html entities($url, ENT_QUOTES, sfConfig::get('sf_charset'))));219 $response->setContent(sprintf('<html><head><meta http-equiv="refresh" content="%d;url=%s"/></head></html>', $delay, htmlspecialchars($url, ENT_QUOTES, sfConfig::get('sf_charset')))); 220 220 221 221 if (!sfConfig::get('sf_test')) 222 222 { -
lib/debug/sfWebDebug.class.php
old new 135 135 } 136 136 137 137 // escape HTML 138 $log_line = html entities($log_line, ENT_QUOTES, sfConfig::get('sf_charset'));138 $log_line = htmlspecialchars($log_line, ENT_QUOTES, sfConfig::get('sf_charset')); 139 139 140 140 // replace constants value with constant name 141 141 $log_line = str_replace(array_keys($constants), array_values($constants), $log_line); … … 397 397 $id = ucfirst(strtolower($id)); 398 398 $content = ' 399 399 <h2>'.$id.' <a href="#" onclick="sfWebDebugToggle(\'sfWebDebug'.$id.'\'); return false;">'.image_tag(sfConfig::get('sf_web_debug_web_dir').'/images/toggle.gif').'</a></h2> 400 <div id="sfWebDebug'.$id.'" style="display: none"><pre>'.html entities(@sfYaml::Dump($values), ENT_QUOTES, sfConfig::get('sf_charset')).'</pre></div>400 <div id="sfWebDebug'.$id.'" style="display: none"><pre>'.htmlspecialchars(@sfYaml::Dump($values), ENT_QUOTES, sfConfig::get('sf_charset')).'</pre></div> 401 401 '; 402 402 403 403 return $content; -
lib/response/sfWebResponse.class.php
old new 472 472 473 473 if ($escape) 474 474 { 475 $value = html entities($value, ENT_QUOTES, sfConfig::get('sf_charset'));475 $value = htmlspecialchars($value, ENT_QUOTES, sfConfig::get('sf_charset')); 476 476 } 477 477 478 478 if ($replace || !$this->getParameter($key, null, 'helper/asset/auto/meta')) -
lib/config/sfViewConfigHandler.class.php
old new 226 226 227 227 foreach ($this->mergeConfigValue('metas', $viewName) as $name => $content) 228 228 { 229 $data[] = sprintf(" \$response->addMeta('%s', '%s', false, false);", $name, str_replace('\'', '\\\'', preg_replace('/&(?=\w+;)/', '&', html entities($content, ENT_QUOTES, sfConfig::get('sf_charset')))));229 $data[] = sprintf(" \$response->addMeta('%s', '%s', false, false);", $name, str_replace('\'', '\\\'', preg_replace('/&(?=\w+;)/', '&', htmlspecialchars($content, ENT_QUOTES, sfConfig::get('sf_charset'))))); 230 230 } 231 231 232 232 return implode("\n", $data)."\n";