Changeset 13181
- Timestamp:
- 02/07/2024 05:58:19 AM (22 months ago)
- Location:
- sites/trunk/trac.wordpress.org/templates
- Files:
-
- 3 edited
-
update-headers.php (modified) (2 diffs)
-
wporg-footer.html (modified) (1 diff)
-
wporg-head.html (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/trac.wordpress.org/templates/update-headers.php
r12855 r13181 7 7 function domdocument_from_url( $url ) { 8 8 $html = file_get_contents( $url ); 9 10 /* 11 * Escape HTML within Javascript strings. 12 * DomDocument doesn't handle HTML tags within Javascript strings. 13 * See https://stackoverflow.com/questions/40703313/php-domdocument-errors-while-parsing-unescaped-strings 14 */ 15 $html = preg_replace_callback( 16 '!<script([^>]+)>(.*?)</script>!ism', 17 function( $m ) { 18 $escaped = $m[2]; 19 $escaped = str_replace( array( '<', '>' ), array( '\x3C', '\x3E' ), $escaped ); 20 return "<script{$m[1]}>{$escaped}</script>"; 21 }, 22 $html 23 ); 9 24 10 25 $doc = new DOMDocument(); … … 42 57 $html = preg_replace( '#<style([^>]*)><!\[CDATA\[(.+?)\]\]></style>#ism', "<style$1>$2</style>", $html ); 43 58 44 // Escape CDATA tags in <script>45 $html = preg_replace( '#<script([^>]*)><!\[CDATA\[(.+?)\]\]></script>#ism', "<script$1> //<![CDATA[\n$2\n//]]></script>", $html );59 // Remove CDATA tags in <script> 60 $html = preg_replace( '#<script([^>]*)><!\[CDATA\[(.+?)\]\]></script>#ism', "<script$1>$2</script>", $html ); 46 61 47 62 // Remove trailing whitespace. -
sites/trunk/trac.wordpress.org/templates/wporg-footer.html
r13180 r13181 66 66 </footer><script src="https://wordpress.org/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-image-cdn/dist/image-cdn.js?minify=false&ver=132249e245926ae3e188" id="jetpack-photon-js"/> 67 67 <script src="https://wordpress.org/wp-content/mu-plugins/pub-sync/blocks/time/build/view.js?ver=362338b9e6592dcf125b" id="wporg-time-view-script-js" defer="defer" data-wp-strategy="defer"/> 68 <script id="wporg-global-header-script-js-extra"> //<![CDATA[68 <script id="wporg-global-header-script-js-extra"> 69 69 var wporgGlobalHeaderI18n = {"openSearchLabel":"Open Search","closeSearchLabel":"Close Search","overflowMenuLabel":"More menu"}; 70 //]]></script>70 </script> 71 71 <script src="https://wordpress.org/wp-content/mu-plugins/pub-sync/blocks/global-header-footer/js/view.js?ver=1697687513" id="wporg-global-header-script-js"/> 72 72 </html> -
sites/trunk/trac.wordpress.org/templates/wporg-head.html
r13180 r13181 11 11 <link rel="dns-prefetch" href="//v0.wordpress.com"/> 12 12 <link rel="dns-prefetch" href="//i0.wp.com"/> 13 <script>//<![CDATA[ 14 (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': 13 <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': 15 14 new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], 16 15 j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 17 16 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); 18 })(window,document,'script','dataLayer','GTM-P24PF4B'); 19 //]]></script> 20 <script>//<![CDATA[ 17 })(window,document,'script','dataLayer','GTM-P24PF4B');</script> 18 <script> 21 19 window._wpemojiSettings = {"baseUrl":"https:\/\/s.w.org\/images\/core\/emoji\/14.0.0\/72x72\/","ext":".png","svgUrl":"https:\/\/s.w.org\/images\/core\/emoji\/14.0.0\/svg\/","svgExt":".svg","source":{"concatemoji":"https:\/\/wordpress.org\/wp-includes\/js\/wp-emoji-release.min.js?ver=6.5-alpha-57545"}}; 22 20 /*! This file is auto-generated */ 23 21 !function(i,n){var o,s,e;function c(e){try{var t={supportTests:e,timestamp:(new Date).valueOf()};sessionStorage.setItem(o,JSON.stringify(t))}catch(e){}}function p(e,t,n){e.clearRect(0,0,e.canvas.width,e.canvas.height),e.fillText(t,0,0);var t=new Uint32Array(e.getImageData(0,0,e.canvas.width,e.canvas.height).data),r=(e.clearRect(0,0,e.canvas.width,e.canvas.height),e.fillText(n,0,0),new Uint32Array(e.getImageData(0,0,e.canvas.width,e.canvas.height).data));return t.every(function(e,t){return e===r[t]})}function u(e,t,n){switch(t){case"flag":return n(e,"\ud83c\udff3\ufe0f\u200d\u26a7\ufe0f","\ud83c\udff3\ufe0f\u200b\u26a7\ufe0f")?!1:!n(e,"\ud83c\uddfa\ud83c\uddf3","\ud83c\uddfa\u200b\ud83c\uddf3")&&!n(e,"\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc65\udb40\udc6e\udb40\udc67\udb40\udc7f","\ud83c\udff4\u200b\udb40\udc67\u200b\udb40\udc62\u200b\udb40\udc65\u200b\udb40\udc6e\u200b\udb40\udc67\u200b\udb40\udc7f");case"emoji":return!n(e,"\ud83e\udef1\ud83c\udffb\u200d\ud83e\udef2\ud83c\udfff","\ud83e\udef1\ud83c\udffb\u200b\ud83e\udef2\ud83c\udfff")}return!1}function f(e,t,n){var r="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?new OffscreenCanvas(300,150):i.createElement("canvas"),a=r.getContext("2d",{willReadFrequently:!0}),o=(a.textBaseline="top",a.font="600 32px Arial",{});return e.forEach(function(e){o[e]=t(a,e,n)}),o}function t(e){var t=i.createElement("script");t.src=e,t.defer=!0,i.head.appendChild(t)}"undefined"!=typeof Promise&&(o="wpEmojiSettingsSupports",s=["flag","emoji"],n.supports={everything:!0,everythingExceptFlag:!0},e=new Promise(function(e){i.addEventListener("DOMContentLoaded",e,{once:!0})}),new Promise(function(t){var n=function(){try{var e=JSON.parse(sessionStorage.getItem(o));if("object"==typeof e&&"number"==typeof e.timestamp&&(new Date).valueOf()<e.timestamp+604800&&"object"==typeof e.supportTests)return e.supportTests}catch(e){}return null}();if(!n){if("undefined"!=typeof Worker&&"undefined"!=typeof OffscreenCanvas&&"undefined"!=typeof URL&&URL.createObjectURL&&"undefined"!=typeof Blob)try{var e="postMessage("+f.toString()+"("+[JSON.stringify(s),u.toString(),p.toString()].join(",")+"));",r=new Blob([e],{type:"text/javascript"}),a=new Worker(URL.createObjectURL(r),{name:"wpTestEmojiSupports"});return void(a.onmessage=function(e){c(n=e.data),a.terminate(),t(n)})}catch(e){}c(n=f(s,u,p))}t(n)}).then(function(e){for(var t in e)n.supports[t]=e[t],n.supports.everything=n.supports.everything&&n.supports[t],"flag"!==t&&(n.supports.everythingExceptFlag=n.supports.everythingExceptFlag&&n.supports[t]);n.supports.everythingExceptFlag=n.supports.everythingExceptFlag&&!n.supports.flag,n.DOMReady=!1,n.readyCallback=function(){n.DOMReady=!0}}).then(function(){return e}).then(function(){var e;n.supports.everything||(n.readyCallback(),(e=n.source||{}).concatemoji?t(e.concatemoji):e.wpemoji&&e.twemoji&&(t(e.twemoji),t(e.wpemoji)))}))}((window,document),window._wpemojiSettings); 24 //]]></script>22 </script> 25 23 <style id="wp-block-navigation-link-inline-css"> 26 24 .wp-block-navigation .wp-block-navigation-item__label{overflow-wrap:break-word}.wp-block-navigation .wp-block-navigation-item__description{display:none} … … 32 30 </style> 33 31 <link rel="stylesheet" id="open-sans-css" href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,600;1,300;1,400;1,600&display=swap" media="all"/> 34 <link rel="stylesheet" id="wp4-styles-css" href="https://s.w.org/style/wp4.css?ver=16451391 11" media="all"/>32 <link rel="stylesheet" id="wp4-styles-css" href="https://s.w.org/style/wp4.css?ver=1645139150" media="all"/> 35 33 <style id="wp-emoji-styles-inline-css"> 36 34 img.wp-smiley, img.emoji { … … 258 256 .wp-container-core-navigation-is-layout-2.wp-container-core-navigation-is-layout-2{flex-direction:column;align-items:flex-start;} 259 257 </style> 260 <link rel="stylesheet" id="wporg-global-fonts-css" href="https://wordpress.org/wp-content/mu-plugins/pub-sync/global-fonts/style.css?ver=1700434 831" media="all"/>261 <link rel="stylesheet" id="wporg-global-header-footer-css" href="https://wordpress.org/wp-content/mu-plugins/pub-sync/blocks/global-header-footer/build/style.css?ver=1706749 233" media="all"/>258 <link rel="stylesheet" id="wporg-global-fonts-css" href="https://wordpress.org/wp-content/mu-plugins/pub-sync/global-fonts/style.css?ver=1700434933" media="all"/> 259 <link rel="stylesheet" id="wporg-global-header-footer-css" href="https://wordpress.org/wp-content/mu-plugins/pub-sync/blocks/global-header-footer/build/style.css?ver=1706749302" media="all"/> 262 260 <link rel="stylesheet" id="jetpack_css-css" href="https://wordpress.org/wp-content/plugins/jetpack/css/jetpack.css?ver=12.9.3" media="all"/> 263 <script id="wp-load-polyfill-importmap"> //<![CDATA[264 ( HTMLScriptElement.supports && HTMLScriptElement.supports("importmap") ) || document.write( ' <script src="https://wordpress.org/wp-includes/js/dist/vendor/wp-polyfill-importmap.min.js?ver=1.8.2">' + 'ipt>' );265 //]]></script>266 <script type="importmap" id="wp-importmap"> //<![CDATA[261 <script id="wp-load-polyfill-importmap"> 262 ( HTMLScriptElement.supports && HTMLScriptElement.supports("importmap") ) || document.write( '\x3Cscript src="https://wordpress.org/wp-includes/js/dist/vendor/wp-polyfill-importmap.min.js?ver=1.8.2"\x3E\x3C/scr' + 'ipt\x3E' ); 263 </script> 264 <script type="importmap" id="wp-importmap"> 267 265 {"imports":{"@wordpress\/interactivity":"https:\/\/wordpress.org\/wp-includes\/js\/dist\/interactivity.min.js?ver=6.5-alpha-57545"}} 268 //]]></script>266 </script> 269 267 <script type="module" src="https://wordpress.org/wp-content/plugins/gutenberg/build/interactivity/navigation.min.js?ver=17.6.3" id="@wordpress/block-library/navigation-js-module"/> 270 268 <link rel="modulepreload" href="https://wordpress.org/wp-includes/js/dist/interactivity.min.js?ver=6.5-alpha-57545" id="@wordpress/interactivity-js-modulepreload"/><link rel="preconnect" href="https://fonts.googleapis.com"/><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin=""/>
Note: See TracChangeset
for help on using the changeset viewer.