Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CiviCRM Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
CiviCRM Core
Commits
9e9bfc47
Unverified
Commit
9e9bfc47
authored
5 years ago
by
bgm
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #15954 from eileenmcnaughton/ex_silly
[REF] CSV Export: Remove impossible checks on var
parents
38891c5d
8c5f84b6
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CRM/Core/Report/Excel.php
+12
-22
12 additions, 22 deletions
CRM/Core/Report/Excel.php
with
12 additions
and
22 deletions
CRM/Core/Report/Excel.php
+
12
−
22
View file @
9e9bfc47
...
...
@@ -50,12 +50,7 @@ class CRM_Core_Report_Excel {
$schema_insert
=
''
;
foreach
(
$header
as
$field
)
{
if
(
$enclosed
==
''
)
{
$schema_insert
.
=
stripslashes
(
$field
);
}
else
{
$schema_insert
.
=
$enclosed
.
str_replace
(
$enclosed
,
$escaped
.
$enclosed
,
stripslashes
(
$field
))
.
$enclosed
;
}
$schema_insert
.
=
$enclosed
.
str_replace
(
$enclosed
,
$escaped
.
$enclosed
,
stripslashes
(
$field
))
.
$enclosed
;
$schema_insert
.
=
$seperator
;
}
// end while
...
...
@@ -85,28 +80,23 @@ class CRM_Core_Report_Excel {
// loic1 : always enclose fields
//$value = ereg_replace("\015(\012)?", "\012", $value);
$value
=
preg_replace
(
"/
\015
(
\012
)?/"
,
"
\012
"
,
$value
);
if
(
$enclosed
==
''
)
{
$schema_insert
.
=
$value
;
}
else
{
if
((
substr
(
$value
,
0
,
1
)
==
CRM_Core_DAO
::
VALUE_SEPARATOR
)
&&
(
substr
(
$value
,
-
1
,
1
)
==
CRM_Core_DAO
::
VALUE_SEPARATOR
)
)
{
if
((
substr
(
$value
,
0
,
1
)
==
CRM_Core_DAO
::
VALUE_SEPARATOR
)
&&
(
substr
(
$value
,
-
1
,
1
)
==
CRM_Core_DAO
::
VALUE_SEPARATOR
)
)
{
$strArray
=
explode
(
CRM_Core_DAO
::
VALUE_SEPARATOR
,
$value
);
$strArray
=
explode
(
CRM_Core_DAO
::
VALUE_SEPARATOR
,
$value
);
foreach
(
$strArray
as
$key
=>
$val
)
{
if
(
trim
(
$val
)
==
''
)
{
unset
(
$strArray
[
$key
]);
}
foreach
(
$strArray
as
$key
=>
$val
)
{
if
(
trim
(
$val
)
==
''
)
{
unset
(
$strArray
[
$key
]);
}
$str
=
implode
(
$seperator
,
$strArray
);
$value
=
&
$str
;
}
$schema_insert
.
=
$enclosed
.
str_replace
(
$enclosed
,
$escaped
.
$enclosed
,
$value
)
.
$enclosed
;
$str
=
implode
(
$seperator
,
$strArray
);
$value
=
&
$str
;
}
$schema_insert
.
=
$enclosed
.
str_replace
(
$enclosed
,
$escaped
.
$enclosed
,
$value
)
.
$enclosed
;
}
else
{
$schema_insert
.
=
''
;
...
...
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