'_commentCB') ,$this->_html); // replace PREs with placeholders $this->_html = preg_replace_callback('/\\s*]*?>[\\s\\S]*?<\\/pre>)\\s*/i' ,array($this, '_removePreCB') ,$this->_html); // replace TEXTAREAs with placeholders $this->_html = preg_replace_callback( '/\\s*]*?>[\\s\\S]*?<\\/textarea>)\\s*/i' ,array($this, '_removeTextareaCB') ,$this->_html); // trim each line. // @todo take into account attribute values that span multiple lines. // Fixed attribute values which span on multiple lines. Causes double spaces " " $this->_html = preg_replace('/^\s+|\s+$/m', ' ', $this->_html); // Fixed double spaces. Replaced with a single space $this->_html = preg_replace('/\s+/', ' ', $this->_html); // remove ws around block/undisplayed elements $this->_html = preg_replace('/\\s+(<\\/?(?:area|article|aside|base(?:font)?|blockquote|body' .'|canvas|caption|center|col(?:group)?|dd|dir|div|dl|dt|fieldset|figcaption|figure|footer|form' .'|frame(?:set)?|h[1-6]|head|header|hgroup|hr|html|legend|li|link|main|map|menu|meta|nav' .'|ol|opt(?:group|ion)|output|p|param|section|t(?:able|body|head|d|h||r|foot|itle)' .'|ul|video)\\b[^>]*>)/i', '$1', $this->_html); // remove ws outside of all elements $this->_html = preg_replace_callback( '/>([^<]+)_html); // fill placeholders $this->_html = str_replace( array_keys($this->_placeholders) ,array_values($this->_placeholders) ,$this->_html ); // issue 229: multi-pass to catch scripts that didn't get replaced in textareas $this->_html = str_replace( array_keys($this->_placeholders) ,array_values($this->_placeholders) ,$this->_html ); return $this->_html; } protected function _commentCB($m) { return ( false !== strpos($m[1], 'fwp-loop') || false !== strpos($m[1], 'ngg_resource_manager_marker') || 0 === strpos($m[1], '[') || false !== strpos($m[1], '_replacementHash . count($this->_placeholders) . '%'; $this->_placeholders[$placeholder] = $content; return $placeholder; } protected $_isXhtml = null; protected $_replacementHash = null; protected $_placeholders = array(); protected $_cssMinifier = null; protected $_jsMinifier = null; protected function _outsideTagCB($m) { return '>' . preg_replace('/^\\s+|\\s+$/', ' ', $m[1]) . '<'; } protected function _removePreCB($m) { return $this->_reservePlace("_reservePlace("\\s*$)/u', '', $css); // remove CDATA section markers $data = $this->_removeCdata($css); // minify $minifier = $this->_cssMinifier ? $this->_cssMinifier : 'trim'; $css = call_user_func($minifier, $data['content']); return $this->_reservePlace( $data['cdata'] ? "{$openStyle}/* */" : "{$openStyle}{$css}" ); } protected function _removeScriptCB($m) { $openScript = "_jsCleanComments) { $js = preg_replace('/(?:^\\s*\\s*$)/u', '', $js); } // remove CDATA section markers $data = $this->_removeCdata($js); // minify $minifier = $this->_jsMinifier ? $this->_jsMinifier : 'trim'; $js = call_user_func($minifier, $data['content']); return $this->_reservePlace($data['cdata'] ? "{$ws1}{$openScript}/* */{$ws2}" : "{$ws1}{$openScript}{$js}{$ws2}" ); } protected function _removeCdata($str) { $data = array(); if ( false !== strpos( $str, ' */' ), '', $str ); $data['cdata'] = true; } else { $data['content'] = $str; $data['cdata'] = false; } return $data; } } Le premier ministre Patrick Achi - JusteInfos- Information générale