diff --git a/swad_RSS.c b/swad_RSS.c
index c7da30a8..012c61a6 100644
--- a/swad_RSS.c
+++ b/swad_RSS.c
@@ -205,7 +205,7 @@ static void RSS_WriteNotices (FILE *FileRSS,struct Course *Crs)
/* Write full content of the notice */
strncpy (Content,row[3],Cns_MAX_BYTES_TEXT);
Content[Cns_MAX_BYTES_TEXT] = '\0';
- Str_InsertLinkInURLs (Content,Cns_MAX_BYTES_TEXT,40);
+ Str_InsertLinks (Content,Cns_MAX_BYTES_TEXT,40);
fprintf (FileRSS,"%s %s %s:
%s
]]>\n",
UsrDat.FirstName,UsrDat.Surname1,UsrDat.Surname2,Content);
diff --git a/swad_announcement.c b/swad_announcement.c
index 9bbd7815..3e320b1b 100644
--- a/swad_announcement.c
+++ b/swad_announcement.c
@@ -156,7 +156,7 @@ void Ann_ShowAllAnnouncements (void)
/* Get the content (row[4]) and insert links */
strncpy (Content,row[4],Cns_MAX_BYTES_TEXT);
Content[Cns_MAX_BYTES_TEXT] = '\0';
- Str_InsertLinkInURLs (Content,Cns_MAX_BYTES_TEXT,50);
+ Str_InsertLinks (Content,Cns_MAX_BYTES_TEXT,50);
/* Show the announcement */
Ann_DrawAnAnnouncement (AnnCod,Status,Subject,Content,
@@ -220,7 +220,7 @@ void Ann_ShowMyAnnouncementsNotMarkedAsSeen (void)
/* Get the content (row[2]) and insert links */
strncpy (Content,row[2],Cns_MAX_BYTES_TEXT);
Content[Cns_MAX_BYTES_TEXT] = '\0';
- Str_InsertLinkInURLs (Content,Cns_MAX_BYTES_TEXT,50);
+ Str_InsertLinks (Content,Cns_MAX_BYTES_TEXT,50);
/* Show the announcement */
Ann_DrawAnAnnouncement (AnnCod,Ann_ACTIVE_ANNOUNCEMENT,Subject,Content,
diff --git a/swad_assignment.c b/swad_assignment.c
index 0624a5b0..3b6ffc56 100644
--- a/swad_assignment.c
+++ b/swad_assignment.c
@@ -328,7 +328,7 @@ static void Asg_ShowOneAssignment (long AsgCod)
Asg_GetAssignmentTxtFromDB (Asg.AsgCod,Txt);
Str_ChangeFormat (Str_FROM_HTML,Str_TO_RIGOROUS_HTML,
Txt,Cns_MAX_BYTES_TEXT,false); // Convert from HTML to recpectful HTML
- Str_InsertLinkInURLs (Txt,Cns_MAX_BYTES_TEXT,60); // Insert links
+ Str_InsertLinks (Txt,Cns_MAX_BYTES_TEXT,60); // Insert links
fprintf (Gbl.F.Out,"",
Gbl.RowEvenOdd);
diff --git a/swad_attendance.c b/swad_attendance.c
index c7f9d98e..0bff55d7 100644
--- a/swad_attendance.c
+++ b/swad_attendance.c
@@ -373,7 +373,7 @@ static void Att_ShowOneAttEvent (struct AttendanceEvent *Att,bool ShowOnlyThisAt
Att_GetAttEventTxtFromDB (Att->AttCod,Txt);
Str_ChangeFormat (Str_FROM_HTML,Str_TO_RIGOROUS_HTML,
Txt,Cns_MAX_BYTES_TEXT,false); // Convert from HTML to recpectful HTML
- Str_InsertLinkInURLs (Txt,Cns_MAX_BYTES_TEXT,60); // Insert links
+ Str_InsertLinks (Txt,Cns_MAX_BYTES_TEXT,60); // Insert links
fprintf (Gbl.F.Out," | ",
Gbl.RowEvenOdd);
diff --git a/swad_changelog.h b/swad_changelog.h
index 412cf6c6..9a2fa6b9 100644
--- a/swad_changelog.h
+++ b/swad_changelog.h
@@ -127,13 +127,14 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
-#define Log_PLATFORM_VERSION "SWAD 15.126 (2016-01-24)"
+#define Log_PLATFORM_VERSION "SWAD 15.126.1 (2016-01-24)"
#define CSS_FILE "swad15.121.7.css"
#define JS_FILE "swad15.121.7.js"
// Number of lines (includes comments but not blank lines) has been got with the following command:
// nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h sql/swad*.sql | tail -1
/*
+ Version 15.126.1: Jan 24, 2016 Optimization in code to insert links. (194736 lines)
Version 15.126: Jan 24, 2016 In any text where URL is replaced by anchor, now @nickname is also replaced to link to user's profile. (194727 lines)
2 changes necessary in database:
UPDATE social_posts SET Content=REPLACE(Content,'@','@');
diff --git a/swad_info.c b/swad_info.c
index 8dd970b9..f0eb6f76 100644
--- a/swad_info.c
+++ b/swad_info.c
@@ -1589,7 +1589,7 @@ static void Inf_ShowPlainTxtInfo (Inf_InfoType_t InfoType)
/***** Convert to respectful HTML and insert links *****/
Str_ChangeFormat (Str_FROM_HTML,Str_TO_RIGOROUS_HTML,
TxtHTML,Cns_MAX_BYTES_LONG_TEXT,false); // Convert from HTML to recpectful HTML
- Str_InsertLinkInURLs (TxtHTML,Cns_MAX_BYTES_LONG_TEXT,60); // Insert links
+ Str_InsertLinks (TxtHTML,Cns_MAX_BYTES_LONG_TEXT,60); // Insert links
/***** Write text *****/
fprintf (Gbl.F.Out,"%s",TxtHTML);
@@ -1757,7 +1757,7 @@ int Inf_WritePlainTextIntoHTMLBuffer (Inf_InfoType_t InfoType,char **HTMLBuffer)
/* Convert to respectful HTML and insert links */
Str_ChangeFormat (Str_FROM_HTML,Str_TO_RIGOROUS_HTML,
TxtHTML,Cns_MAX_BYTES_LONG_TEXT,false); // Convert from HTML to recpectful HTML
- Str_InsertLinkInURLs (TxtHTML,Cns_MAX_BYTES_LONG_TEXT,60); // Insert links
+ Str_InsertLinks (TxtHTML,Cns_MAX_BYTES_LONG_TEXT,60); // Insert links
/* Write text */
fprintf (FileHTMLTmp,"%s",TxtHTML);
diff --git a/swad_message.c b/swad_message.c
index 506e6acf..e34076e3 100644
--- a/swad_message.c
+++ b/swad_message.c
@@ -3392,7 +3392,7 @@ void Msg_WriteMsgContent (char *Content,unsigned long MaxLength,bool InsertLinks
{
/***** Insert links in URLs *****/
if (InsertLinks)
- Str_InsertLinkInURLs (Content,MaxLength,60);
+ Str_InsertLinks (Content,MaxLength,60);
/***** Write message to file *****/
if (ChangeBRToRet)
diff --git a/swad_notice.c b/swad_notice.c
index 7c9a270e..f0f7449a 100644
--- a/swad_notice.c
+++ b/swad_notice.c
@@ -449,7 +449,7 @@ void Not_ShowNotices (Not_Listing_t TypeNoticesListing,bool ICanEditNotices)
/* Get the content (row[3]) and insert links */
strncpy (Content,row[3],Cns_MAX_BYTES_TEXT);
- Str_InsertLinkInURLs (Content,Cns_MAX_BYTES_TEXT,
+ Str_InsertLinks (Content,Cns_MAX_BYTES_TEXT,
Not_MaxCharsURLOnScreen[TypeNoticesListing]);
if (TypeNoticesListing == Not_LIST_BRIEF_NOTICES)
Str_LimitLengthHTMLStr (Content,Not_MAX_CHARS_ON_NOTICE);
@@ -514,7 +514,7 @@ static void Not_GetDataAndShowNotice (long NotCod,bool ICanEditNotices)
/* Get the content (row[2]) and insert links*/
strncpy (Content,row[2],Cns_MAX_BYTES_TEXT);
- Str_InsertLinkInURLs (Content,Cns_MAX_BYTES_TEXT,
+ Str_InsertLinks (Content,Cns_MAX_BYTES_TEXT,
Not_MaxCharsURLOnScreen[Not_LIST_FULL_NOTICES]);
/* Get status of the notice (row[3]) */
diff --git a/swad_string.c b/swad_string.c
index ce15249c..b0e947b2 100644
--- a/swad_string.c
+++ b/swad_string.c
@@ -76,7 +76,7 @@ static const char Str_CR[2] = {13,0};
/*****************************************************************************/
/*****************************************************************************/
-/************************* Insert links in URLs ******************************/
+/****************** Insert a link in every URL or nickname *******************/
/*****************************************************************************/
/*
Insertion example:
@@ -91,20 +91,20 @@ The web site of @rms is "
"%s"
""
|