1
0

Port from master

This commit is contained in:
Garvin Hicking
2013-01-21 10:06:09 +01:00
parent 88f69a298e
commit 53ea38aa3c
15 changed files with 73 additions and 24 deletions

View File

@ -161,6 +161,26 @@ $tasks = array(array('version' => '0.5.1',
'title' => 'Introduce author groups',
'desc' => 'This version introduces customizable user groups. Your existing users will be migrated into the new default groups.'),
array('version' => '1.7-rc2',
'type' => 'PLUGIN_NOTICE',
'function' => '',
'title' => '<b>PLUGIN NOTICE:</b> Due to PHP 5.2+\'s raised error reporting, every Serendipity event plugin needs to conform to the core plugin API method signature.',
'desc' => '<p>All internal and spartacus plugins have been updated to reflect this change. The most important signatures are:</p>'
. '<p><strong>function uninstall(&$propbag)</strong><br />'
. '<strong>function event_hook($event, &$bag, &$eventData, $addData = null)</strong></p>'
. '<p>Older plugins specifically did not always include the <strong>$addData</strong> signature. Make sure this exists.
If after installation you get uncircumventable errors, you can make sure to set <strong>$serendipity[\'product\'] = true;</strong> in your <strong>serendipity_config_local.inc.php</strong> file. This should lower error reporting to a way that will not interfere with incompatible problem. But this is no solution in the long run, you need to update your plugins.
Also, the serendipity_event_browsercompatibility plugin has been removed, because it\'s functionality was no longer required. You should uninstall that plugin if you are currently using it.</p>'),
array('version' => '1.7-rc2',
'type' => 'TEMPLATE_NOTICE',
'function' => '',
'title' => '<b>TEMPLATE_NOTICE:</b> The template file "entries.tpl" needs a specific assignment',
'desc' => 'To transport the $entry variable to sub-templates like comments.tpl and trackbacks.tpl.
All internal and spartacus templates have been updated, so make sure you are using a recent version of your blog\'s template.
If you have your own custom template, be sure within your {foreach from=$dategroup.entries item="entry"} loop has this line after it:
<strong>{assign var="entry" value=$entry scope=parent}</strong>'),
);
/* Fetch SQL files which needs to be run */

View File

@ -82,6 +82,7 @@ if (!function_exists('errorToExceptionHandler')) {
global $serendipity;
$rep = ini_get('error_reporting');
// respect user has set php error_reporting to not display any errors at all
if (!($rep & $errStr)) { return false; }
// user used @ to specify ignoring all errors or $php_errormsg messages returned with error_reporting = 0
@ -90,6 +91,9 @@ if (!function_exists('errorToExceptionHandler')) {
if ($serendipity['production'] === true && ini_get('display_errors') == 0) { return false; }
// any other errors go here - throw errors as exception
if ($serendipity['production'] === 'debug') {
// We don't want the notices
echo '<p> == FULL DEBUG ERROR MODE == </p>';
echo '<pre>';
// trying to be as detailled as possible
@ -100,10 +104,17 @@ if (!function_exists('errorToExceptionHandler')) {
echo '</pre>'; // if throw new ... endtag is not set, it still looks better and browsers don't care
}
if ($serendipity['production'] !== true) {
$args = func_get_args();
// Several plugins might not adapt to proper style. This should not completely kill our execution.
if ($serendipity['production'] !== 'debug' && preg_match('@Declaration.*should be compatible with@i', $args[1])) {
#if (!headers_sent()) echo "<strong>Compatibility warning:</strong> Please upgrade file old '{$args[2]}', it contains incompatible signatures.<br/>Details: {$args[1]}<br/>";
return false;
}
$e = new Exception;
echo '<p> == TESTING ERROR MODE == </p>';
echo '<pre>';
print_r(func_get_args());
print_r($args);
print_r($e);
throw new ErrorException("Serendipity error: " . $errStr); // tracepath = all;
echo '</pre>'; // if throw new ... endtag is not set, it still looks better and browsers don't care

View File

@ -49,7 +49,7 @@ function serendipity_db_in_sql($col, &$search_ids, $type = ' OR ') {
function serendipity_db_connect() {
global $serendipity;
$host = port = '';
$host = $port = '';
if (strlen($serendipity['dbHost'])) {
if (false !== strstr($serendipity['dbHost'], ':')) {
$tmp = explode(':', $serendipity['dbHost']);

View File

@ -53,7 +53,7 @@ function serendipity_db_connect() {
$function = 'pg_connect';
}
$host = port = '';
$host = $port = '';
if (strlen($serendipity['dbHost'])) {
if (false !== strstr($serendipity['dbHost'], ':')) {
$tmp = explode(':', $serendipity['dbHost']);

View File

@ -1,4 +1,4 @@
<?php // (experimental) serendipity_smarty_class.inc.php 2012-06-13 16:09 Ian
<?php // (experimental) serendipity_smarty_class.inc.php 2012-01-03 14:11 Ian
// define secure_dir and trusted_dirs for Serendipity_Smarty_Security_Policy class.
@define('S9Y_TEMPLATE_FALLBACK', $serendipity['serendipityPath'] . $serendipity['templatePath'] . 'default');
@ -309,10 +309,8 @@ class Serendipity_Smarty extends Smarty
}
// set smarty error reporting. General error_reporting is set in serendipity/serendipity_config.inc.php
$this->error_reporting = E_ALL & ~E_NOTICE ^ E_STRICT;
$this->error_reporting = E_ALL & ~(E_NOTICE|E_STRICT);
// we use our own error_handler and get in conflicts with smarty?
#$this->muteExpectedErrors();
}
/*