Skip to content

Commit

Permalink
Fix PHP5 warnings (E_STRICT flag)
Browse files Browse the repository at this point in the history
  • Loading branch information
kerphi committed Mar 15, 2011
1 parent 361d17c commit 416ae42
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 20 deletions.
2 changes: 1 addition & 1 deletion lib/csstidy-1.2/class.csstidy.php
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,7 @@ function merge_css_blocks($media,$selector,$css_add)
* @access public
* @version 1.0
*/
function is_important(&$value)
static function is_important(&$value)
{
return (!strcasecmp(substr(str_replace($GLOBALS['csstidy']['whitespace'],'',$value),-10,10),'!important'));
}
Expand Down
8 changes: 4 additions & 4 deletions src/pfccommand.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class pfcCommand
* Used to instanciate a command
* $tag is the command name : "nick", "me", "update" ...
*/
function &Factory($name)
static function &Factory($name)
{
$c =& pfcGlobalConfig::Instance();

Expand Down Expand Up @@ -180,7 +180,7 @@ function forceWhoisReload($nickid)
* @param $cmdp is the command's parameters
* @return false if $nickid is blank, true for all other values of $nickid
*/
function AppendCmdToPlay($nickid, $cmdstr, $cmdp)
static function AppendCmdToPlay($nickid, $cmdstr, $cmdp)
{
$c =& pfcGlobalConfig::Instance();
$u =& pfcUserConfig::Instance();
Expand Down Expand Up @@ -215,7 +215,7 @@ function AppendCmdToPlay($nickid, $cmdstr, $cmdp)
* @param $context
* @param $xml_reponse
*/
function RunPendingCmdToPlay($nickid, $context, &$xml_reponse)
static function RunPendingCmdToPlay($nickid, $context, &$xml_reponse)
{
$c =& pfcGlobalConfig::Instance();
$u =& pfcUserConfig::Instance();
Expand Down Expand Up @@ -264,7 +264,7 @@ function trace(&$xml_reponse, $msg, $data = NULL)

}

function ParseCommand($cmd_str, $one_parameter = false)
static function ParseCommand($cmd_str, $one_parameter = false)
{
$pattern_quote = '/([^\\\]|^)"([^"]+[^\\\])"/';
$pattern_quote = '/"([^"]+)"/';
Expand Down
4 changes: 2 additions & 2 deletions src/pfccontainer.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* pfccontainer.class.php
*
* Copyright 2006 Stephane Gully <[email protected]>
* Copyright © 2006 Stephane Gully <[email protected]>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -36,7 +36,7 @@ class pfcContainer extends pfcContainerInterface
var $_usememorycache = true;


function &Instance($type = 'File', $usememorycache = true)
static function &Instance($type = 'File', $usememorycache = true)
{
static $i;
if (!isset($i))
Expand Down
2 changes: 1 addition & 1 deletion src/pfcglobalconfig.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ function pfcGlobalConfig( $params = array() )
$this->nick = $this->filterNickname($this->nick);
}

function &Instance( $params = array(), $destroy_instance = false )
static function &Instance( $params = array(), $destroy_instance = false )
{
static $i;
if ($destroy_instance)
Expand Down
12 changes: 6 additions & 6 deletions src/pfci18n.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* pfci18n.class.php
*
* Copyright © 2006 Stephane Gully <[email protected]>
* Copyright © 2006 Stephane Gully <[email protected]>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -51,7 +51,7 @@ function _pfc2()

class pfcI18N
{
function Init($language,$type="main")
static function Init($language,$type="main")
{
if ($type=="admin")
if (!in_array($language, pfcI18N::GetAcceptedLanguage("admin")))
Expand All @@ -73,7 +73,7 @@ function Init($language,$type="main")
/**
* Switch output encoding in order to write the right characteres in the web page
*/
function SwitchOutputEncoding($oe = "")
static function SwitchOutputEncoding($oe = "")
{
if ($oe == "")
{
Expand All @@ -92,7 +92,7 @@ function SwitchOutputEncoding($oe = "")
/**
* Return the default language : "en"
*/
function GetDefaultLanguage()
static function GetDefaultLanguage()
{
return "en_US";
}
Expand All @@ -102,15 +102,15 @@ function GetDefaultLanguage()
* (content of the i18n directory)
* fix for the slovak language UTAN
*/
function GetAcceptedLanguage($type="main")
static function GetAcceptedLanguage($type="main")
{
return /*<GetAcceptedLanguage>*/array('nl_NL','ko_KR','nl_BE','tr_TR','pt_PT','en_US','eo','hr_HR','vi_VN','es_ES','zh_TW','nn_NO','ru_RU','id_ID','hu_HU','th_TH','hy_AM','oc_FR','da_DK','de_DE-formal','uk_RO','nb_NO','fr_FR','it_IT','sv_SE','uk_UA','sr_CS','ar_LB','bg_BG','pt_BR','ba_BA','bn_BD','el_GR','zh_CN','gl_ES','pl_PL','de_DE-informal','ja_JP','sk_SK');/*</GetAcceptedLanguage>*/
}

/**
* Parse the source-code and update the i18n ressources files
*/
function UpdateMessageRessources()
static function UpdateMessageRessources()
{
// first of all, update the GetAcceptedLanguage list
$i18n_basepath = dirname(__FILE__).'/../i18n';
Expand Down
2 changes: 1 addition & 1 deletion src/pfcuserconfig.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function pfcUserConfig()
if (!isset($this->serverid)) $this->_setParam("serverid",$c->serverid);
}

function &Instance()
static function &Instance()
{
static $i;

Expand Down
11 changes: 6 additions & 5 deletions src/phpfreechat.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,15 @@ function printChat( $return = false )
/**
* Encode special caracteres and remove extra slashes
*/
function FilterSpecialChar($str)
static function FilterSpecialChar($str)
{
return htmlspecialchars($str, ENT_NOQUOTES);
}

/**
* Just check the nicknames doesn't start with spaces and is not longer than the max_nick_len
*/
function FilterNickname($nickname)
static function FilterNickname($nickname)
{
$c =& pfcGlobalConfig::Instance();
//$nickname = str_replace("\\", "", $nickname); // '\' is a forbidden charactere for nicknames
Expand All @@ -148,7 +148,7 @@ function FilterNickname($nickname)
/**
* search/replace smileys
*/
function FilterSmiley($msg)
static function FilterSmiley($msg)
{
$c =& pfcGlobalConfig::Instance();
// build a preg_replace array
Expand Down Expand Up @@ -179,7 +179,7 @@ function FilterSmiley($msg)
/**
* Filter messages before they are sent to container
*/
function PreFilterMsg($msg)
static function PreFilterMsg($msg)
{
$c =& pfcGlobalConfig::Instance();
if (preg_match("/^\[/i",$msg))
Expand All @@ -204,7 +204,7 @@ function PreFilterMsg($msg)
/**
* Filter messages when they are recived from container
*/
function PostFilterMsg($msg)
static function PostFilterMsg($msg)
{
//$c =& pfcGlobalConfig::Instance();
// $msg = preg_replace('/('.preg_quote($c->nick,'/').')/i', "<strong>$1</strong>", $msg );
Expand Down Expand Up @@ -459,6 +459,7 @@ function &loadScripts($theme, &$xml_reponse)
"OK", // _pfc
"Cancel", // _pfc
"You are trying to speak to a unknown (or not connected) user", // _pfc
"Sorry %s couldn't be found", // _pfc
);
foreach($labels_to_load as $l)
{
Expand Down

0 comments on commit 416ae42

Please sign in to comment.