[opw-web] Fix mangling of line breaks when editing descriptions
- From: Owen Taylor <otaylor src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [opw-web] Fix mangling of line breaks when editing descriptions
- Date: Wed, 19 Mar 2014 15:40:02 +0000 (UTC)
commit e4f47471c513b935033fe56ed4a94629afefcaed
Author: Owen W. Taylor <otaylor fishsoup net>
Date: Wed Mar 19 11:37:09 2014 -0400
Fix mangling of line breaks when editing descriptions
Don't substitute new lines with <br /> when filling in the existing
content for the description text box.
modules/mod_view_projects.php | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/modules/mod_view_projects.php b/modules/mod_view_projects.php
index ca1a224..1cca451 100644
--- a/modules/mod_view_projects.php
+++ b/modules/mod_view_projects.php
@@ -320,12 +320,16 @@ if ($action == 'editor')
$cancel_url = !empty($return_url) ? "?q=view_projects&prg={$program_id}&p={$project_id}"
: "?q=program_home&prg={$program_id}";
+ $escaped_description = htmlspecialchars($description);
+ $escaped_description = preg_replace('/\n/', ' ', $escaped_description);
+ $escaped_description = preg_replace('/\r/', ' ', $escaped_description);
+
// Assign skin data
$skin->assign(array(
'editor_title' => $page_title,
'program_id' => $program_id,
'project_title' => htmlspecialchars($title),
- 'project_description' => nl2br(htmlspecialchars($description)),
+ 'project_description' => $escaped_description,
'new_mentor' => htmlspecialchars($new_mentor),
'organization_select' => build_organization_select($program_id, $organization_id,
false,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]