GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — develop ( 4690c8...bf80d8 )
by gyeong-won
08:37
created

procSeoAdminInsertModuleConfig()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 20

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 0
dl 0
loc 20
rs 9.6
c 0
b 0
f 0
1
<?php
2
class seoAdminController extends seo
3
{
4
	function procSeoAdminSaveSetting()
5
	{
6
		$oModuleController = getController('module');
7
8
		$vars = Context::getRequestVars();
9
		$config = $this->getConfig();
10
11
		if ($vars->setting_section == 'general') {
12
			// 기본 설정
13
			$config->enable = ($vars->enable === 'Y') ? 'Y' : 'N';
0 ignored issues
show
Bug introduced by
The property enable does not seem to exist in BaseObject.

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
14
			$config->use_optimize_title = $vars->use_optimize_title;
0 ignored issues
show
Bug introduced by
The property use_optimize_title does not seem to exist in BaseObject.

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
15
			$config->site_name = $vars->site_name;
0 ignored issues
show
Bug introduced by
The property site_name does not seem to exist in BaseObject.

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
16
			$config->site_slogan = $vars->site_slogan;
0 ignored issues
show
Bug introduced by
The property site_slogan does not seem to exist in BaseObject.

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
17
			$config->site_description = $vars->site_description;
0 ignored issues
show
Bug introduced by
The property site_description does not seem to exist in BaseObject.

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
18
			$config->site_keywords = $vars->site_keywords;
0 ignored issues
show
Bug introduced by
The property site_keywords does not seem to exist in BaseObject.

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
19
20
			if ($vars->site_image) {
21
				$path = _XE_PATH_ . 'files/attach/site_image/';
22
				$ext = strtolower(array_pop(explode('.', $vars->site_image['name'])));
0 ignored issues
show
Bug introduced by
explode('.', $vars->site_image['name']) cannot be passed to array_pop() as the parameter $array expects a reference.
Loading history...
Bug introduced by
The property site_image does not seem to exist in BaseObject.

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
23
				$timestamp = time();
24
				$filename = "site_image.{$timestamp}.{$ext}";
25
				FileHandler::copyFile($vars->site_image['tmp_name'], $path . $filename);
26
				$config->site_image = $filename;
27
28
				$oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE);
29 View Code Duplication
				if($oCacheHandler->isSupport()) {
30
					list($width, $height) = @getimagesize($path . $filename);
31
					$site_image_dimension = array(
32
						'width' => $width,
33
						'height' => $height
34
					);
35
					$cache_key = 'seo:site_image';
36
					$oCacheHandler->put($cache_key, $site_image_dimension);
37
				}
38
			}
39
		} elseif ($vars->setting_section == 'analytics') {
0 ignored issues
show
Bug introduced by
The property setting_section does not seem to exist in BaseObject.

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
40
			// analytics
41
42
			// Google
43
			$config->ga_id = trim($vars->ga_id);
0 ignored issues
show
Bug introduced by
The property ga_id does not seem to exist in BaseObject.

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
44
			$config->ga_except_admin = $vars->ga_except_admin;
0 ignored issues
show
Bug introduced by
The property ga_except_admin does not seem to exist in BaseObject.

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
45
46
			// Naver
47
			$config->na_id = trim($vars->na_id);
0 ignored issues
show
Bug introduced by
The property na_id does not seem to exist in BaseObject.

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
48
			$config->na_except_admin = $vars->na_except_admin;
0 ignored issues
show
Bug introduced by
The property na_except_admin does not seem to exist in BaseObject.

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
49
		} elseif ($vars->setting_section == 'miscellaneous') {
50
			// miscellaneous
51
52
			// Facebook
53
			$config->fb_app_id = trim($vars->fb_app_id);
0 ignored issues
show
Bug introduced by
The property fb_app_id does not seem to exist in BaseObject.

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
54
			$config->fb_admins = trim($vars->fb_admins);
0 ignored issues
show
Bug introduced by
The property fb_admins does not seem to exist in BaseObject.

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
55
		}
56
57
		$config->site_image_url = NULL;
58
59
		$oModuleController->updateModuleConfig('seo', $config);
60
61
		if($config->enable === 'Y') {
62
			$this->moduleUpdate();
63
		} else {
64
			// Delete Triggers
65
			$oModuleController = getController('module');
66
			$oModuleController->deleteModuleTriggers('seo');
67
		}
68
69
		$this->setMessage('success_updated');
70
		if (Context::get('success_return_url')) {
71
			$this->setRedirectUrl(Context::get('success_return_url'));
72
		}
73
	}
74
75
	function procSeoAdminInsertModuleConfig()
76
	{
77
		$vars = Context::getRequestVars();
78
		$oModule = getModel('module');
79
80
		$modulePartConfig = $oModule->getModulePartConfig('seo', $vars->target_module_srl);
0 ignored issues
show
Bug introduced by
The property target_module_srl does not seem to exist in BaseObject.

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
81
82
		if (!$modulePartConfig) {
83
			$modulePartConfig = new stdClass();
84
		}
85
86
87
		$modulePartConfig->meta_description = htmlspecialchars($vars->meta_description, ENT_COMPAT | ENT_HTML401, 'UTF-8', FALSE);
0 ignored issues
show
Bug introduced by
The property meta_description does not seem to exist in BaseObject.

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
88
89
		$oModuleController = getController('module');
90
		$output = $oModuleController->insertModulePartConfig('seo', $vars->target_module_srl, $modulePartConfig);
0 ignored issues
show
Unused Code introduced by
$output is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
91
92
		$this->setMessage('success_updated', 'info');
93
		$this->setRedirectUrl($vars->success_return_url);
0 ignored issues
show
Bug introduced by
The property success_return_url does not seem to exist in BaseObject.

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
94
	}
95
}
96
/* !End of file */
97