Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
vtigercrm
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Welcome to Vtiger Community. To gain access for account, please contact [ community @ vtiger.com ]
Show more breadcrumbs
Code80
vtigercrm
Commits
fc42b0a4
Commit
fc42b0a4
authored
8 years ago
by
Prasad
Browse files
Options
Downloads
Patches
Plain Diff
Sanitized company logo name while saving.
parent
d08456d7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/Settings/Vtiger/actions/CompanyDetailsSave.php
+7
-4
7 additions, 4 deletions
modules/Settings/Vtiger/actions/CompanyDetailsSave.php
modules/Settings/Vtiger/models/CompanyDetails.php
+8
-6
8 additions, 6 deletions
modules/Settings/Vtiger/models/CompanyDetails.php
with
15 additions
and
10 deletions
modules/Settings/Vtiger/actions/CompanyDetailsSave.php
+
7
−
4
View file @
fc42b0a4
...
...
@@ -17,14 +17,17 @@ class Settings_Vtiger_CompanyDetailsSave_Action extends Settings_Vtiger_Basic_Ac
$status
=
false
;
if
(
$request
->
get
(
'organizationname'
))
{
$saveLogo
=
$status
=
true
;
$saveLogo
=
$status
=
true
;
$binFileName
=
false
;
if
(
!
empty
(
$_FILES
[
'logo'
][
'name'
]))
{
$logoDetails
=
$_FILES
[
'logo'
];
$saveLogo
=
Vtiger_Functions
::
validateImage
(
$logoDetails
);
if
(
is_string
(
$saveLogo
))
$saveLogo
=
(
$saveLogo
==
'false'
)
?
false
:
true
;
global
$upload_badext
;
$binFileName
=
sanitizeUploadFileName
(
$logoDetails
[
'name'
],
$upload_badext
);
if
(
$saveLogo
)
{
$moduleModel
->
saveLogo
();
$moduleModel
->
saveLogo
(
$binFileName
);
}
}
else
{
$saveLogo
=
true
;
...
...
@@ -33,8 +36,8 @@ class Settings_Vtiger_CompanyDetailsSave_Action extends Settings_Vtiger_Basic_Ac
foreach
(
$fields
as
$fieldName
=>
$fieldType
)
{
$fieldValue
=
$request
->
get
(
$fieldName
);
if
(
$fieldName
===
'logoname'
)
{
if
(
!
empty
(
$logoDetails
[
'name'
]))
{
$fieldValue
=
ltrim
(
basename
(
" "
.
$
logoDetails
[
'n
ame
'
]
));
if
(
!
empty
(
$logoDetails
[
'name'
])
&&
$binFileName
)
{
$fieldValue
=
ltrim
(
basename
(
" "
.
$
binFileN
ame
));
}
else
{
$fieldValue
=
$moduleModel
->
get
(
$fieldName
);
}
...
...
This diff is collapsed.
Click to expand it.
modules/Settings/Vtiger/models/CompanyDetails.php
+
8
−
6
View file @
fc42b0a4
...
...
@@ -89,11 +89,13 @@ class Settings_Vtiger_CompanyDetails_Model extends Settings_Vtiger_Module_Model
/**
* Function to save the logoinfo
*/
public
function
saveLogo
()
{
$uploadDir
=
vglobal
(
'root_directory'
)
.
'/'
.
$this
->
logoPath
;
$logoName
=
$uploadDir
.
$_FILES
[
"logo"
][
"name"
];
move_uploaded_file
(
$_FILES
[
"logo"
][
"tmp_name"
],
$logoName
);
copy
(
$logoName
,
$uploadDir
.
'application.ico'
);
public
function
saveLogo
(
$binFileName
)
{
if
(
$binFileName
)
{
$uploadDir
=
vglobal
(
'root_directory'
)
.
'/'
.
$this
->
logoPath
;
$logoName
=
$uploadDir
.
$binFileName
;
move_uploaded_file
(
$_FILES
[
"logo"
][
"tmp_name"
],
$logoName
);
copy
(
$logoName
,
$uploadDir
.
'application.ico'
);
}
}
/**
...
...
@@ -165,4 +167,4 @@ class Settings_Vtiger_CompanyDetails_Model extends Settings_Vtiger_Module_Model
}
return
self
::
$settings
[
$fieldname
];
}
}
\ No newline at end of file
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment