From 1a61a857df07d12ed37b503249ed6e6574e077e7 Mon Sep 17 00:00:00 2001
From: David Beniamine <david.beniamine@tetras-libre.fr>
Date: Mon, 2 Oct 2017 13:16:11 +0200
Subject: [PATCH] Patch to fix Dolibarr issue #7420

---
 DOLIBARR_PACKAGES/apply_patch.sh | 3 +++
 installDolibarr.sh               | 2 ++
 upgradeDolibarr.sh               | 1 +
 3 files changed, 6 insertions(+)
 create mode 100644 DOLIBARR_PACKAGES/apply_patch.sh

diff --git a/DOLIBARR_PACKAGES/apply_patch.sh b/DOLIBARR_PACKAGES/apply_patch.sh
new file mode 100644
index 0000000..e15f5a1
--- /dev/null
+++ b/DOLIBARR_PACKAGES/apply_patch.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+echo "Fixing Dolibarr bug #7420"
+sed -i.bak "178s@'\(__[^_]*__\)'@'/\1/'@g"  /usr/share/dolibarr/htdocs/includes/odtphp/Segment.php
diff --git a/installDolibarr.sh b/installDolibarr.sh
index 7d28fac..7892d7f 100644
--- a/installDolibarr.sh
+++ b/installDolibarr.sh
@@ -182,4 +182,6 @@ fi
 echo "cd ${SCRIPT_DIRECTORY}"
 cd ${SCRIPT_DIRECTORY}
 
+[ -f "DOLIBARR_PACKAGES/apply_patch.sh" ] && /bin/bash DOLIBARR_PACKAGES/apply_patch.sh
+
 
diff --git a/upgradeDolibarr.sh b/upgradeDolibarr.sh
index 6193901..2cede64 100644
--- a/upgradeDolibarr.sh
+++ b/upgradeDolibarr.sh
@@ -47,5 +47,6 @@ dpkg -i $package
 echo "Fixing dependencies"
 apt-get -f install
 rm /usr/share/dolibarr/documents/install.lock
+[ -f "DOLIBARR_PACKAGES/apply_patch.sh" ] && /bin/bash DOLIBARR_PACKAGES/apply_patch.sh
 echo "One final step is required to upgrade to Dolibarr $last_repo_version:"
 echo "Please go to your Dolibarr page and run the manual upgrade step"
-- 
GitLab