El problema es que los mensajes con gran cantidad de caracteres (codigo BBC) no se muestran, al intentar cargar el mensaje solo carga una página en blanco.
Estuve mirando el Log de errores y no detecta ninguno, en la instalación de la actualización no hubo ningún problema, realice las tareas de mantenimiento del foro y no detecto errores.
He notado que solo pasa con los mensajes grandes con mucho código BBC.
A algien mas le paso algo parecido?
Saludos!
PD:
Segui buscando y encontre un link de SMF http://wiki.simplemachines.org/smf/What_the_white_screen_of_death_means_when_accessing_admin_or_package_installs
Probe modificar el Class-Package.php y Admin.php y sigue igual...
Del phpinfo.php dice esto:
Directive Local Value - Master Value
max_execution_time 30 - 30
max_file_uploads 20 - 20
max_input_nesting_level 64 - 64
max_input_time 60 - 60
max_input_vars 1000-1000
memory_limit 70M - 70M
En el log de errores del Cpanel
[Sat Jan 25 05:01:48 2014] [error] [client xx] Fatal error: Allowed memory size of 73400320 bytes exhausted (tried to allocate 5760 bytes) in /home/xxxx/public_html/Sources/Subs.php(2747) : runtime-created function(11) : runtime-created function on line 69
[Sat Jan 25 04:59:49 2014] [error] [client xx] Allowed memory size of 73400320 bytes exhausted (tried to allocate 12288 bytes) in /home/xxxx/public_html/Sources/Subs.php(2747) : runtime-created function(11) : runtime-created function on line 68
[Sat Jan 25 04:56:21 2014] [error] [client xx] Allowed memory size of 73400320 bytes exhausted (tried to allocate 20290 bytes) in /home/xxxx/public_html/cache/data_2355a6a2c2d90f363b89616c3af98bff-SMF-parsing_smileys.php on line 0
[Sat Jan 25 04:56:05 2014] [error] [client xx] Fatal error: Allowed memory size of 73400320 bytes exhausted (tried to allocate 10240 bytes) in /home/xxxx/public_html/Sources/Subs.php(2747) : runtime-created function(11) : runtime-created function on line 125
[Sat Jan 25 04:55:49 2014] [error] [client xx] Fatal error: Allowed memory size of 73400320 bytes exhausted (tried to allocate 7040 bytes) in /home/xxxx/public_html/Sources/Subs.php(2747) : runtime-created function(11) : runtime-created function on line 85
[Sat Jan 25 04:54:50 2014] [error] [client xx] Fatal error: Allowed memory size of 73400320 bytes exhausted (tried to allocate 12288 bytes) in /home/xxxx/public_html/Sources/Subs.php(2747) : runtime-created function(11) : runtime-created function on line 68
[Sat Jan 25 04:54:29 2014] [error] [client xx] Fatal error: Allowed memory size of 73400320 bytes exhausted (tried to allocate 5760 bytes) in /home/xxxx/public_html/Sources/Subs.php(2747) : runtime-created function(11) : runtime-created function on line 69
PD2:
Adjunto el Subs.php desde la linea 2726 a 2765, creo que el error debe estar aca pero no tengo idea...
// Replace away!
// TODO: When SMF supports only PHP 5.3+, we can change this to "uses" keyword and simplify this.
$callback = pregReplaceCurry('smielyPregReplaceCallback', 2);
$message = preg_replace_callback($smileyPregSearch, $callback($smileyPregReplacements), $message);
}
// This allows use to do delayed argument binding and bring in the replacement variables for some preg replacements.
function pregReplaceCurry($func, $arity)
{
return create_function('', "
\$args = func_get_args();
if(count(\$args) >= $arity)
return call_user_func_array('$func', \$args);
\$args = var_export(\$args, 1);
return create_function('','
\$a = func_get_args();
\$z = ' . \$args . ';
\$a = array_merge(\$z,\$a);
return call_user_func_array(\'$func\', \$a);
');
");
}
// Our callback that does the actual smiley replacements.
function smielyPregReplaceCallback($replacements, $matches)
{
return $replacements[$matches[1]];
}
// Highlight any code...
function highlight_php_code($code)
{
global $context;
// Remove special characters.
$code = un_htmlspecialchars(strtr($code, array('<br />' => "\n", "\t" => 'SMF_TAB();', '[' => '[')));
$oldlevel = error_reporting(0);
// It's easier in 4.2.x+.
Me sucede lo mismo y no he hallado solución alguna salvo quitar el parche 2.0.7 :-\
Ami tambien me paso, al actualizar la version algunos hilos "desaparecieron" y no se podia entrar a ellos, ya que se quedaba la pantalla en blanco.
Al quitar la version 2.0.7 y volver a la 2.0.6 este problema desaparecio y se pudo entrar a los hilos afectados sin problema.
Porque puede ser? Como se soluciona¿?
Es una de las desventajas de ofrecer soporte para multiples versiones de PHP, incluido PHP 5.5
El error se debe a que cuando un mensaje tiene muchos smilies, se crean multiples funciones anónimas que ocupan la mayor parte de la memoria disponible para el script.
Solucionarlo no es sencillo, todavia hay muchas personas que aún siguen usando php 5.0, 5.2 o incluso 4.x y la solución ideal conlleva dejar de soportar esas versiones, por lo tanto estamos en una encrucijada.
Si ustedes no usan php 5.5 pueden revertir a 2.0.6 y solo aplicar los cambios en materia de seguridad.
Muchas gracias por responder ^^
Revise mi host y tienes razón, estoy usando la Versión de PHP 5.4.19
Cuando hablas de "aplicar los cambios en materia de seguridad" a cuales te refieres?
>> Aquí están las modificaciones de 2.0.6 a 2.0.7 << (http://custom.simplemachines.org/upgrades/index.php?action=upgrade;file=smf_patch_2.0.7.tar.gz;smf_version=2.0.6)
Cuales serian de todas las modificaciones, los cambios de seguridad? asi los modifico manualmente.
Muchas gracias por tu tiempo!
Saludos!
Quote from: Suki on January 30, 2014, 10:14:00 AM
Si ustedes no usan php 5.5 pueden revertir a 2.0.6 y solo aplicar los cambios en materia de seguridad.
A mí también me gustaría saber cómo se puede hacer un upgrade selectivo.
Saludos
Realicen todas las operaciones menos las que cambian la función preg_replace() por preg_replace_callback() esas modificaciones son las encargadas de ofrecer compatibilidad con php 5.5.
Quote from: Suki on February 01, 2014, 12:10:06 PM
Realicen todas las operaciones menos las que cambian la función preg_replace() por preg_replace_callback() esas modificaciones son las encargadas de ofrecer compatibilidad con php 5.5.
Disculpa la ignorancia. Entiendo que la forma de hacerlo es modificar todas esas operaciones a mano en los ficheros que toque, excepto los que comentas, ¿no?.
Gracias y saludos
Antes que nada muchísimas gracias!
Ya actualice todos los cambios de seguridad y funciona perfectamente el foro!
Aquí dejo el método que use, no sé si estará bien pero hasta ahora no detecte ningún error. Creo que es el método mas rápido para actualizar y con la posibilidad de hacer un Downgrade (deshacer los cambios) si no funciona (aunque previamente hice respaldo del foro enteros por las dudas de que todo explote jajaja)
Bueno, antes que nada me baje el archivo para actualizar de 2.0.6 a 2.0.7 >> de aqui << (http://custom.simplemachines.org/upgrades/)
Una vez descargado el archivo smf_patch_2.0.7.tar.gz lo descomprimí y me quedaron 3 archivos.
Me puse a editar el archivo smf_2-0-7_patch.xml (en mi caso con Notepad++) sacando todos los cambios que contenían " preg_replace_callback() "
Archivo modificado (Solo cambios de seguridad)
<?xml version="1.0"?>
<!DOCTYPE modification SYSTEM "http://www.simplemachines.org/xml/modification">
<modification xmlns="http://www.simplemachines.org/xml/modification" xmlns:smf="http://www.simplemachines.org/">
<id>smf:smf-2.0.7</id>
<version>1.0</version>
<file name="$boarddir/index.php">
<operation>
<search position="replace"><![CDATA[
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.6
]]></search>
<add><![CDATA[
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.7
]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[
$forum_version = 'SMF 2.0.6';
]]></search>
<add><![CDATA[
$forum_version = 'SMF 2.0.7';
]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[header('X-XSS-Protection: 1; mode=block');]]></search>
<add><![CDATA[header('X-XSS-Protection: 1');]]></add>
</operation>
</file>
<file name="$sourcedir/Profile-Modify.php">
<operation>
<search position="replace"><![CDATA[
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.6
]]></search>
<add><![CDATA[
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.7
]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[elseif (substr($row['mask'], 0, 5) == 'regex' && preg_match(substr($row['mask'], 5), $value) === 0)]]></search>
<add><![CDATA[elseif (substr($row['mask'], 0, 5) == 'regex' && trim($value) != '' && preg_match(substr($row['mask'], 5), $value) === 0)]]></add>
</operation>
</file>
<file name="$sourcedir/Register.php">
<operation>
<search position="replace"><![CDATA[
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.6
]]></search>
<add><![CDATA[
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.7
]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[elseif (substr($row['mask'], 0, 5) == 'regex' && preg_match(substr($row['mask'], 5), $value) === 0)]]></search>
<add><![CDATA[elseif (substr($row['mask'], 0, 5) == 'regex' && trim($value) != '' && preg_match(substr($row['mask'], 5), $value) === 0)]]></add>
</operation>
</file>
<file name="$sourcedir/DbSearch-postgresql.php">
<operation>
<search position="replace"><![CDATA[
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0
]]></search>
<add><![CDATA[
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.7
]]></add>
</operation>
<operation>
<search position="replace"><![CDATA['~TYPE=HEAP~i' => '',]]></search>
<add><![CDATA['~ENGINE=MEMORY~i' => '',]]></add>
</operation>
</file>
<file name="$sourcedir/DbSearch-sqlite.php">
<operation>
<search position="replace"><![CDATA[
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0
]]></search>
<add><![CDATA[
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.7
]]></add>
</operation>
<operation>
<search position="replace"><![CDATA['~TYPE=HEAP~i' => '',]]></search>
<add><![CDATA['~ENGINE=MEMORY~i' => '',]]></add>
</operation>
</file>
<file name="$sourcedir/Search.php">
<operation>
<search position="replace"><![CDATA[
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0
]]></search>
<add><![CDATA[
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.7
]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[CREATE TEMPORARY TABLE {db_prefix}tmp_log_search_topics (
id_topic mediumint(8) unsigned NOT NULL default {string:string_zero},
PRIMARY KEY (id_topic)
) TYPE=HEAP]]></search>
<add><![CDATA[CREATE TEMPORARY TABLE {db_prefix}tmp_log_search_topics (
id_topic mediumint(8) unsigned NOT NULL default {string:string_zero},
PRIMARY KEY (id_topic)
) ENGINE=MEMORY]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[CREATE TEMPORARY TABLE {db_prefix}tmp_log_search_messages (
id_msg int(10) unsigned NOT NULL default {string:string_zero},
PRIMARY KEY (id_msg)
) TYPE=HEAP]]></search>
<add><![CDATA[CREATE TEMPORARY TABLE {db_prefix}tmp_log_search_messages (
id_msg int(10) unsigned NOT NULL default {string:string_zero},
PRIMARY KEY (id_msg)
) ENGINE=MEMORY]]></add>
</operation>
</file>
<file name="$themedir/Themes.template.php">
<operation>
<search position="replace"><![CDATA[
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0
]]></search>
<add><![CDATA[
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.7
]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[var sBaseUseUrl = smf_prepareScriptUrl(smf_scripturl) + \'action=theme;sa=pick;u=', $context['current_member'], ';th=', $theme['id'], ';', $context['session_var'], '=', $context['session_id'], '\';
var sBasePreviewUrl = smf_prepareScriptUrl(smf_scripturl) + \'action=theme;sa=pick;u=', $context['current_member'], ';theme=', $theme['id'], ';', $context['session_var'], '=', $context['session_id'], '\';]]></search>
<add><![CDATA[var sBaseUseUrl', $theme['id'], ' = smf_prepareScriptUrl(smf_scripturl) + \'action=theme;sa=pick;u=', $context['current_member'], ';th=', $theme['id'], ';', $context['session_var'], '=', $context['session_id'], '\';
var sBasePreviewUrl', $theme['id'], ' = smf_prepareScriptUrl(smf_scripturl) + \'action=theme;sa=pick;u=', $context['current_member'], ';theme=', $theme['id'], ';', $context['session_var'], '=', $context['session_id'], '\';]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[document.getElementById(\'theme_use_', $theme['id'], '\').href = sBaseUseUrl + \';vrt=\' + sVariant;
document.getElementById(\'theme_thumb_preview_', $theme['id'], '\').href = sBasePreviewUrl + \';vrt=\' + sVariant + \';variant=\' + sVariant;
document.getElementById(\'theme_preview_', $theme['id'], '\').href = sBasePreviewUrl + \';vrt=\' + sVariant + \';variant=\' + sVariant;]]></search>
<add><![CDATA[document.getElementById(\'theme_use_', $theme['id'], '\').href = sBaseUseUrl', $theme['id'], ' + \';vrt=\' + sVariant;
document.getElementById(\'theme_thumb_preview_', $theme['id'], '\').href = sBasePreviewUrl', $theme['id'], ' + \';vrt=\' + sVariant + \';variant=\' + sVariant;
document.getElementById(\'theme_preview_', $theme['id'], '\').href = sBasePreviewUrl', $theme['id'], ' + \';vrt=\' + sVariant + \';variant=\' + sVariant;]]></add>
</operation>
</file>
<file name="$boarddir/SSI.php">
<operation>
<search position="replace"><![CDATA[
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.4
]]></search>
<add><![CDATA[
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.7
]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[ WHERE ' . ($board === null ? '' : 'id_board = {int:current_board}
AND ') . 'FIND_IN_SET(-1, member_groups)
LIMIT 1]]></search>
<add><![CDATA[ WHERE ' . ($board === null ? '' : 'id_board = {int:current_board}
AND ') . 'FIND_IN_SET(-1, member_groups) != 0
LIMIT 1]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[ OR id_post_group = {int:id_group}
OR FIND_IN_SET({int:id_group}, additional_groups)';]]></search>
<add><![CDATA[ OR id_post_group = {int:id_group}
OR FIND_IN_SET({int:id_group}, additional_groups) != 0';]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[return ssi_queryPosts($query_where, $query_where_params, '', 'm.id_msg DESC', $output_method);]]></search>
<add><![CDATA[return ssi_queryPosts($query_where, $query_where_params, '', 'm.id_msg DESC', $output_method, false, $override_permissions);]]></add>
</operation>
</file>
<!-- This one doesn't have a version number! -->
<file name="$themedir/scripts/editor.js">
<operation>
<search position="replace"><![CDATA[function smc_BBCButtonBox(oOptions)
{
this.opt = oOptions;
this.init();
}]]></search>
<add><![CDATA[function smc_BBCButtonBox(oOptions)
{
this.opt = oOptions;
this.init();
var items = ['sActiveButtonBackgroundImageHover', 'sActiveButtonBackgroundImage', 'sButtonBackgroundImageHover', 'sButtonBackgroundImage'];
for (var i = 0; i < items.length; i++)
{
if (items[i] in this.opt)
this.opt[items[i]] = this.opt[items[i]].replace(' ', '%20');
}
}]]></add>
</operation>
</file>
<file name="$sourcedir/ScheduledTasks.php">
<operation>
<search position="replace"><![CDATA[
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0
]]></search>
<add><![CDATA[
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.7
]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[SELECT /*!40001 SQL_NO_CACHE */ id_mail, recipient, body, subject, headers, send_html]]></search>
<add><![CDATA[SELECT /*!40001 SQL_NO_CACHE */ id_mail, recipient, body, subject, headers, send_html, time_sent, private]]></add>
</operation>
<operation>
<search position="replace"><![CDATA['headers' => $row['headers'],
'send_html' => $row['send_html'],]]></search>
<add><![CDATA['headers' => $row['headers'],
'send_html' => $row['send_html'],
'time_sent' => $row['time_sent'],
'private' => $row['private'],]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[$failed_emails[] = array($email['to'], $email['body'], $email['subject'], $email['headers'], $email['send_html']);]]></search>
<add><![CDATA[$failed_emails[] = array($email['to'], $email['body'], $email['subject'], $email['headers'], $email['send_html'], $email['time_sent'], $email['private']);]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[array('recipient' => 'string', 'body' => 'string', 'subject' => 'string', 'headers' => 'string', 'send_html' => 'string'),]]></search>
<add><![CDATA[array('recipient' => 'string', 'body' => 'string', 'subject' => 'string', 'headers' => 'string', 'send_html' => 'string', 'time_sent' => 'string', 'private' => 'int'),]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[SET value = {string:mail_next_send}
WHERE variable = {string:next_mail_send}]]></search>
<add><![CDATA[SET value = {string:next_mail_send}
WHERE variable = {string:mail_next_send}]]></add>
</operation>
<operation>
<search position="replace"><
);]]></search>
<add><
);]]></add>
</operation>
</file>
<file name="$sourcedir/Load.php">
<operation>
<search position="replace"><![CDATA[
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.3
]]></search>
<add><![CDATA[
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.7
]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[require($cachedir . '/data_' . $key . '.php');]]></search>
<add><![CDATA[@include($cachedir . '/data_' . $key . '.php');]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[ $fh = @fopen($cachedir . '/data_' . $key . '.php', 'w');
if ($fh)
{
// Write the file.
set_file_buffer($fh, 0);
flock($fh, LOCK_EX);
$cache_bytes = fwrite($fh, $cache_data);
flock($fh, LOCK_UN);
fclose($fh);
// Check that the cache write was successful; all the data should be written
// If it fails due to low diskspace, remove the cache file
if ($cache_bytes != strlen($cache_data))
@unlink($cachedir . '/data_' . $key . '.php');
}]]></search>
<add><![CDATA[ // Write the file.
if (function_exists('file_put_contents'))
{
$cache_bytes = @file_put_contents($cachedir . '/data_' . $key . '.php', $cache_data, LOCK_EX);
if ($cache_bytes != strlen($cache_data))
@unlink($cachedir . '/data_' . $key . '.php');
}
else
{
$fh = @fopen($cachedir . '/data_' . $key . '.php', 'w');
if ($fh)
{
// Write the file.
set_file_buffer($fh, 0);
flock($fh, LOCK_EX);
$cache_bytes = fwrite($fh, $cache_data);
flock($fh, LOCK_UN);
fclose($fh);
// Check that the cache write was successful; all the data should be written
// If it fails due to low diskspace, remove the cache file
if ($cache_bytes != strlen($cache_data))
@unlink($cachedir . '/data_' . $key . '.php');
}
}]]></add>
</operation>
</file>
<file name="$sourcedir/Subs-Post.php">
<operation>
<search position="replace"><![CDATA[
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0
]]></search>
<add><![CDATA[
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.7
]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[ // Have a go at getting the right mime type.
if (empty($attachmentOptions['mime_type']) && $attachmentOptions['width'])
{
if (!empty($size['mime']))
$attachmentOptions['mime_type'] = $size['mime'];
elseif (isset($validImageTypes[$size[2]]))
$attachmentOptions['mime_type'] = 'image/' . $validImageTypes[$size[2]];
}
if (!empty($attachmentOptions['width']) && !empty($attachmentOptions['height']))]]></search>
<add><![CDATA[ // Have a go at getting the right mime type.
if (empty($attachmentOptions['mime_type']) && $attachmentOptions['width'])
{
if (!empty($size['mime']))
$attachmentOptions['mime_type'] = $size['mime'];
elseif (isset($validImageTypes[$size[2]]))
$attachmentOptions['mime_type'] = 'image/' . $validImageTypes[$size[2]];
}
// It is possible we might have a MIME type that isn't actually an image but still have a size.
// For example, Shockwave files will be able to return size but be 'application/shockwave' or similar.
if (!empty($attachmentOptions['mime_type']) && strpos($attachmentOptions['mime_type'], 'image/') !== 0)
{
$attachmentOptions['width'] = 0;
$attachmentOptions['height'] = 0;
}
if (!empty($attachmentOptions['width']) && !empty($attachmentOptions['height']))]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[ // Get the hash if no hash has been given yet.]]></search>
<add><![CDATA[ // It is possible we might have a MIME type that isn't actually an image but still have a size.
// For example, Shockwave files will be able to return size but be 'application/shockwave' or similar.
if (!empty($attachmentOptions['mime_type']) && strpos($attachmentOptions['mime_type'], 'image/') !== 0)
{
$attachmentOptions['width'] = 0;
$attachmentOptions['height'] = 0;
}
// Get the hash if no hash has been given yet.]]></add>
</operation>
</file>
<file name="$sourcedir/LogInOut.php">
<operation>
<search position="replace"><![CDATA[
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.6
]]></search>
<add><![CDATA[
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.7
]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[// Are we using any sort of integration to validate the login?]]></search>
<add>< > 80)
{
$_POST['user'] = $smcFunc['substr']($_POST['user'], 0, 79);
$context['default_username'] = preg_replace('~&#(\\d{1,7}|x[0-9a-fA-F]{1,6});~', '&#\\1;', $smcFunc['htmlspecialchars']($_POST['user']));
}
// Are we using any sort of integration to validate the login?]]></add>
</operation>
</file>
<file name="$sourcedir/ManageMembergroups.php">
<operation>
<search position="replace"><![CDATA[
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0
]]></search>
<add><![CDATA[
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.7
]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[if ($_POST['group_inherit'] != -2 && !allowedTo('admin_forum'))]]></search>
<add><![CDATA[if ($_REQUEST['group'] > 1 && $_REQUEST['group'] != 3 && isset($_POST['group_inherit']) && $_POST['group_inherit'] != -2 && !allowedTo('admin_forum'))]]></add>
</operation>
</file>
<file name="$sourcedir/Subs.php">
<operation>
<search position="replace"><![CDATA[
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.6
]]></search>
<add><![CDATA[
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.7
]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[ $modSettings[$hook] = implode(',', $functions);
}
]]></search>
<add><![CDATA[ $modSettings[$hook] = implode(',', $functions);
}
// Decode numeric html entities to their ascii or UTF8 equivalent character.
function replaceEntities__callback($matches)
{
global $context;
if (!isset($matches[2]))
return '';
$num = $matches[2][0] === 'x' ? hexdec(substr($matches[2], 1)) : (int) $matches[2];
// remove left to right / right to left overrides
if ($num === 0x202D || $num === 0x202E)
return '';
// Quote, Ampersand, Apostrophe, Less/Greater Than get html replaced
if (in_array($num, array(0x22, 0x26, 0x27, 0x3C, 0x3E)))
return '&#' . $num . ';';
if (empty($context['utf8']))
{
// no control characters
if ($num < 0x20)
return '';
// text is text
elseif ($num < 0x80)
return chr($num);
// all others get html-ised
else
return '&#' . $matches[2] . ';';
}
else
{
// <0x20 are control characters, 0x20 is a space, > 0x10FFFF is past the end of the utf8 character set
// 0xD800 >= $num <= 0xDFFF are surrogate markers (not valid for utf8 text)
if ($num < 0x20 || $num > 0x10FFFF || ($num >= 0xD800 && $num <= 0xDFFF))
return '';
// <0x80 (or less than 128) are standard ascii characters a-z A-Z 0-9 and puncuation
elseif ($num < 0x80)
return chr($num);
// <0x800 (2048)
elseif ($num < 0x800)
return chr(($num >> 6) + 192) . chr(($num & 63) + 128);
// < 0x10000 (65536)
elseif ($num < 0x10000)
return chr(($num >> 12) + 224) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128);
// <= 0x10FFFF (1114111)
else
return chr(($num >> 18) + 240) . chr((($num >> 12) & 63) + 128) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128);
}
}
// Converts html entities to utf8 equivalents.
function fixchar__callback($matches)
{
if (!isset($matches[1]))
return '';
$num = $matches[1][0] === 'x' ? hexdec(substr($matches[1], 1)) : (int) $matches[1];
// <0x20 are control characters, > 0x10FFFF is past the end of the utf8 character set
// 0xD800 >= $num <= 0xDFFF are surrogate markers (not valid for utf8 text), 0x202D-E are left to right overrides
if ($num < 0x20 || $num > 0x10FFFF || ($num >= 0xD800 && $num <= 0xDFFF) || $num === 0x202D || $num === 0x202E)
return '';
// <0x80 (or less than 128) are standard ascii characters a-z A-Z 0-9 and puncuation
elseif ($num < 0x80)
return chr($num);
// <0x800 (2048)
elseif ($num < 0x800)
return chr(($num >> 6) + 192) . chr(($num & 63) + 128);
// < 0x10000 (65536)
elseif ($num < 0x10000)
return chr(($num >> 12) + 224) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128);
// <= 0x10FFFF (1114111)
else
return chr(($num >> 18) + 240) . chr((($num >> 12) & 63) + 128) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128);
}
// Strips out invalid html entities, replaces others with html style { codes.
function entity_fix__callback($matches)
{
if (!isset($matches[2]))
return '';
$num = $matches[2][0] === 'x' ? hexdec(substr($matches[2], 1)) : (int) $matches[2];
// we don't allow control characters, characters out of range, byte markers, etc
if ($num < 0x20 || $num > 0x10FFFF || ($num >= 0xD800 && $num <= 0xDFFF) || $num == 0x202D || $num == 0x202E)
return '';
else
return '&#' . $num . ';';
}
]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[$/e', "\$scripturl . '/' . strtr('\$1', '&;=', '//,') . '.html\$2?' . SID", $setLocation);]]></search>
<add><![CDATA[$~', create_function('$m', 'global $scripturl; return $scripturl . \'/\' . strtr("$m[1]", \'&;=\', \'//,\') . \'.html?\' . SID . (isset($m[2]) ? "$m[2]" : "");'), $setLocation);]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[$/e', "\$scripturl . '/' . strtr('\$1', '&;=', '//,') . '.html\$2'", $setLocation);]]></search>
<add><![CDATA[$~', create_function('$m', 'global $scripturl; return $scripturl . \'/\' . strtr("$m[1]", \'&;=\', \'//,\') . \'.html\' . (isset($m[2]) ? "$m[2]" : "");'), $setLocation);]]></add>
</operation>
</file>
<file name="$sourcedir/ManageMaintenance.php">
<operation>
<search position="replace"><![CDATA[
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.1
]]></search>
<add><![CDATA[
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.7
]]></add>
</operation>
</file>
<file name="$sourcedir/Subs-Auth.php">
<operation>
<search position="replace"><![CDATA[
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0
]]></search>
<add><![CDATA[
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.7
]]></add>
</operation>
</file>
<file name="$sourcedir/Display.php">
<operation>
<search position="replace"><![CDATA[
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0
]]></search>
<add><![CDATA[
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.7
]]></add>
</operation>
</file>
<file name="$sourcedir/Subs-Members.php">
<operation error="ignore">
<search position="replace"><![CDATA[
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.1
]]></search>
<add><![CDATA[
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.7
]]></add>
</operation>
<operation error="ignore">
<search position="replace"><![CDATA[
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.6
]]></search>
<add><![CDATA[
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.7
]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[ // The admin might've used entities too, level the playing field.
$reservedCheck = preg_replace('~(&#(\d{1,7}|x[0-9a-fA-F]{1,6});)~e', '$replaceEntities(\'\\2\')', $reserved);
]]></search>
<add><![CDATA[ // The admin might've used entities too, level the playing field.
$reservedCheck = preg_replace('~(&#(\d{1,7}|x[0-9a-fA-F]{1,6});)~', 'replaceEntities__callback', $reserved);
]]></add>
</operation>
</file>
<file name="$sourcedir/Modlog.php">
<operation>
<search position="replace"><![CDATA[
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.3
]]></search>
<add><![CDATA[
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.7
]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[ // Do some formatting of the action string.
foreach ($entries as $k => $entry)
]]></search>
<add><![CDATA[ // Do some formatting of the action string.
$callback = pregReplaceCurry('list_getModLogEntriesCallback', 3);
foreach ($entries as $k => $entry)
]]></add>
</operation>
</file>
<file name="$sourcedir/Subs-Editor.php">
<operation>
<search position="replace"><![CDATA[
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0
]]></search>
<add><![CDATA[
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.7
]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[ '~</tr>~i' => '[/tr]',
'~<(td|th)\s[^<>]*?colspan="?(\d{1,2})"?.*?' . '>~ie' => 'str_repeat(\'[td][/td]\', $2 - 1) . \'[td]\'',
'~<(td|th)(\s(.)*?)*?' . '>~i' => '[td]',
]]></search>
<add><![CDATA[ '~</tr>~i' => '[/tr]',
'~<(td|th)(\s(.)*?)*?' . '>~i' => '[td]',
]]></add>
</operation>
</file>
<file name="$sourcedir/Class-Package.php">
<operation>
<search position="replace"><![CDATA[
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0
]]></search>
<add><![CDATA[
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.7
]]></add>
</operation>
</file>
<file name="$sourcedir/Post.php">
<operation>
<search position="replace"><![CDATA[
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0
]]></search>
<add><![CDATA[
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.7
]]></add>
</operation>
</file>
<file name="$sourcedir/News.php">
<operation>
<search position="replace"><![CDATA[
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0
]]></search>
<add><![CDATA[
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.7
]]></add>
</operation>
</file>
<file name="$sourcedir/QueryString.php">
<operation>
<search position="replace"><![CDATA[
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.6
]]></search>
<add><![CDATA[
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.7
]]></add>
</operation>
<operation>
<search position="replace"><![CDATA["/e', "'\"' . \$scripturl . '/' . strtr('\$1', '&;=', '//,') . '.html?' . SID . '\$2\"'", $buffer);]]></search>
<add><![CDATA["~', create_function('$m', 'global $scripturl; return \'"\' . $scripturl . "/" . strtr("$m[1]", \'&;=\', \'//,\') . ".html?" . SID . (isset($m[2]) ? $m[2] : "") . \'"\';'), $buffer);]]></add>
</operation>
<operation>
<search position="replace"><![CDATA["/e', "'\"' . \$scripturl . '/' . strtr('\$1', '&;=', '//,') . '.html\$2\"'", $buffer);]]></search>
<add><![CDATA["~', create_function('$m', 'global $scripturl; return \'"\' . $scripturl . "/" . strtr("$m[1]", \'&;=\', \'//,\') . ".html" . (isset($m[2]) ? $m[2] : "") . \'"\';'), $buffer);]]></add>
</operation>
</file>
<file name="$languagedir/index.english.php">
<operation error="ignore">
<search position="replace"><![CDATA[// Version: 2.0.4; index]]></search>
<add><![CDATA[// Version: 2.0.7; index]]></add>
</operation>
<operation error="ignore">
<search position="replace"><![CDATA[ <a href="http://www.simplemachines.org/about/smf/license.php" title="License" target="_blank" class="new_win">SMF © 2013</a>, <a href="http://www.simplemachines.org" title="Simple Machines" target="_blank" class="new_win">Simple Machines</a>';]]></search>
<add><![CDATA[ <a href="http://www.simplemachines.org/about/smf/license.php" title="License" target="_blank" class="new_win">SMF © 2014</a>, <a href="http://www.simplemachines.org" title="Simple Machines" target="_blank" class="new_win">Simple Machines</a>';]]></add>
</operation>
</file>
</modification>
Una vez editado lo guarde y hice un nuevo archivo ".zip" con los 3 archivos:
fix_calendar.php
package-info.xml
smf_2-0-7_patch.xml (editado)
Al archivo zip lo nombre como smf_2-0-7_patch.zip y lo subí a mi foro en "public_html/Packages" que aquí es donde se encuentran todos los paquetes modificadores del foro.
Una vez hecho esto, me metí en el foro (hay que tener permisos administrador) y me dirigí a la solapa Administracion -> Paquetes (aquí aparece toda la lista de paquetes instalados y no instalados que se encuentran en la carpeta "Packages" del foro)
Busque el smf_2-0-7_patch.zip que subí a mi foro y le di "instalar mod"
Me tiro todos éxitos, continúe y todos funciona hasta el momento.
Edito: Para desinstalar la actualización en caso de tener problemas, lo hacemos del mismo modo en que lo instalamos:
Vamos a la solapa Administracion -> Paquetes y en ves de instalar mod"
Busque el smf_2-0-7_patch.zip y en vez de "instalar mod" nos va a aparecer "Desinstalar mod", le dan clic y siguen las instrucciones ^^
Desde ya muchas gracias por tu tiempo y espero que les sirva a todos los que tiene este problema.
Un saludo!
Muchas gracias EvolucionX!!. He cogido tu xml y he subido el paquete, parece que todo funciona bien.
Gracias de nuevo ;)
Quote from: EvolucionX on February 01, 2014, 05:01:31 PM
Me puse a editar el archivo smf_2-0-7_patch.xml (en mi caso con Notepad++) sacando todos los cambios que contenían " preg_replace_callback() "
O sea... has hecho una actualización incompleta? no se si entendí bien...
No es una actualización incompleta, si no usas PHP 5.5 entonces no hay ningún motivo para realizar los cambios pra la compatibilidad con PHP 5.5.