Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix potential bug

  • Loading branch information...
commit 807903d51cf90d67c42499de7267f4a72cb477c1 1 parent 7a8cf28
@rande authored
Showing with 7 additions and 7 deletions.
  1. +6 −6 lib/helper/swToolboxHelper.php
  2. +1 −1  lib/swToolbox.class.php
View
12 lib/helper/swToolboxHelper.php
@@ -330,7 +330,7 @@ function sw_get_user_notice()
return $html;
}
-function sw_user_context_var($varname)
+function sw_user_context_var($varname, $default = null)
{
static
$config,
@@ -364,12 +364,12 @@ function sw_user_context_var($varname)
if(!$common || !isset($common['callback']))
{
- return;
+ return $default;
}
$vars = call_user_func($common['callback'], $context);
- return isset($vars[$varname]) ? $vars[$varname] : null;
+ return isset($vars[$varname]) ? $vars[$varname] : $default;
}
/**
@@ -404,13 +404,13 @@ function sw_include_partial($templateName, array $vars = array())
$actionName = '_'.$templateName;
$format = $request->getRequestFormat();
-
- if($format != 'html' || $format != null)
+
+ if($format != 'html' && $format != null)
{
$actionName .= '.'.$format;
}
- $actionName = $actionName.'php';
+ $actionName = $actionName.'.php';
$key = $moduleName.'::'.$actionName;
if(!isset($cache[$key]))
View
2  lib/swToolbox.class.php
@@ -72,6 +72,6 @@ static function updateFormElements(sfForm $form, sfWidget $widget, array $elemen
static function convertFileInformation($taintedFiles)
{
- throw new RuntimeException('Please update the '.get_class($form).' sfForm class. This method is now deprecated, use swFormHelper::convertFileInformation (swFormExtraPlugin)');
+ throw new RuntimeException('Please update the sfForm class. This method is now deprecated, use swFormHelper::convertFileInformation (swFormExtraPlugin)');
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.