Skip to content

Commit

Permalink
Various E_STRICT error fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
brendo committed May 11, 2013
1 parent d552701 commit e631d85
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions symphony/content/content.login.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function view() {
$fieldset = new XMLElement('fieldset');

// Display retrieve password UI
if($this->_context[0] == 'retrieve-password'):
if(isset($this->_context[0]) && $this->_context[0] == 'retrieve-password'):
$this->Form->setAttribute('action', SYMPHONY_URL.'/login/retrieve-password/');

if(isset($this->_email_sent) && $this->_email_sent) {
Expand Down Expand Up @@ -101,7 +101,7 @@ public function view() {

// Username
$label = Widget::Label(__('Username'));
$username = Widget::Input('username', General::sanitize($_POST['username']));
$username = Widget::Input('username', isset($_POST['username']) ? General::sanitize($_POST['username']) : null);
if(!$this->failedLoginAttempt) {
$username->setAttribute('autofocus', 'autofocus');
}
Expand Down
2 changes: 1 addition & 1 deletion symphony/lib/core/class.administration.php
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ public function getPageCallback($page = null){
$callback = array(
'driver' => 'login',
'driver_location' => CONTENT . '/content.login.php',
'context' => preg_split('/\//', $bits[1] . '/' . $bits[2], -1, PREG_SPLIT_NO_EMPTY),
'context' => isset($bits[1], $bits[2]) ? preg_split('/\//', $bits[1] . '/' . $bits[2], -1, PREG_SPLIT_NO_EMPTY) : array(),
'classname' => 'contentLogin',
'pageroot' => '/login/'
);
Expand Down
2 changes: 1 addition & 1 deletion symphony/lib/core/class.cookie.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public function get($name = null) {
return $_SESSION[$this->_index];
}

if (is_array($_SESSION[$this->_index]) && array_key_exists($name, $_SESSION[$this->_index])) {
if (isset($_SESSION[$this->_index]) && is_array($_SESSION[$this->_index]) && array_key_exists($name, $_SESSION[$this->_index])) {
return $_SESSION[$this->_index][$name];
}

Expand Down
2 changes: 1 addition & 1 deletion symphony/lib/core/class.symphony.php
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ public static function getPageNamespace() {
self::$namespace = sprintf('/%s/%s/%s', $bits[0], $bits[1], $bits[2]);
}
else {
self::$namespace = sprintf('/%s/%s', $bits[0], $bits[1]);
self::$namespace = sprintf('/%s/%s', $bits[0], isset($bits[1]) ? $bits[1] : '');
}
}

Expand Down
4 changes: 2 additions & 2 deletions symphony/lib/toolkit/class.frontendpage.php
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ private function __buildPage(){
'symphony-version' => Symphony::Configuration()->get('version', 'symphony'),
);

if(is_array($this->_env['url'])){
if(isset($this->_env['url']) && is_array($this->_env['url'])){
foreach($this->_env['url'] as $key => $val) $this->_param[$key] = $val;
}

Expand Down Expand Up @@ -424,7 +424,7 @@ private function __buildPage(){
Symphony::Profiler()->seed($xml_build_start);
Symphony::Profiler()->sample('XML Built', PROFILE_LAP);

if(is_array($this->_env['pool']) && !empty($this->_env['pool'])) {
if(isset($this->_env['pool']) && is_array($this->_env['pool']) && !empty($this->_env['pool'])) {
foreach($this->_env['pool'] as $handle => $p){

if(!is_array($p)) $p = array($p);
Expand Down
2 changes: 1 addition & 1 deletion symphony/lib/toolkit/class.widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ public static function Error(XMLElement $element, $message) {
* set by previous params, except the `id` attribute.
* @return XMLElement
*/
public function Drawer($id = '', $label = '', XMLElement $content = null, $default_state = 'closed', $context = '', array $attributes = array()){
public static function Drawer($id = '', $label = '', XMLElement $content = null, $default_state = 'closed', $context = '', array $attributes = array()){
$id = General::createHandle($id);

$contents = new XMLElement('div', $content, array(
Expand Down
6 changes: 3 additions & 3 deletions symphony/lib/toolkit/fields/field.upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,11 @@ public function displayPublishPanel(XMLElement &$wrapper, $data = null, $flagWit

$span = new XMLElement('span', NULL, array('class' => 'frame'));

$filename = ($data['file'])
$filename = (array_key_exists('file', $data) && $data['file'])
? $this->get('destination') . '/' . basename($data['file'])
: null;

if ($data['file']) {
if (array_key_exists('file', $data) && $data['file']) {
$file = $this->getFilePath($data['file']);
if (file_exists($file) === false || !is_readable($file)) {
$flagWithError = __('The file uploaded is no longer available. Please check that it exists, and is readable.');
Expand Down Expand Up @@ -539,7 +539,7 @@ public function appendFormattedElement(XMLElement &$wrapper, $data, $encode = fa
}

public function prepareTableValue($data, XMLElement $link=NULL, $entry_id = null){
if (!$file = $data['file']) {
if (!array_key_exists('file', $data) || !$file = $data['file']) {
if ($link) return parent::prepareTableValue(null, $link, $entry_id);
else return parent::prepareTableValue(null, $link, $entry_id);
}
Expand Down

0 comments on commit e631d85

Please sign in to comment.