Check out the LimeSurvey source code on GitHub!

Where can I find the display code for survey links?

4 years 1 month ago - 4 years 1 month ago #91733 by Sirblackadder
Hi All,

my limesurvey installation is of the http variant. However, I use mod-rewrite in .htaccess to force https for the admin subdirectory.

Unfortunately, this has limesurvey display the client link to a survey with "https", too. Such a link is displayed on the overview page for a survey, for example (./admin/survey/sa/view/surveyid/).

Where is this link generated? I'd like to add a preg_replace() to the code but don't know where to find it. Can you help?

Best wishes,

Please Log in to join the conversation.

4 years 4 weeks ago - 4 years 4 weeks ago #91836 by Sirblackadder
Ok, solved it. The survey summary display code is in /application/views/admin/survey/surveySummary_view.php

There are two lines in the file where survey links are generated. Both go like
<?php $tmp_url = ...?>

To change https links into http links, you can insert the statements
if (strcasecmp(substr($tmp_url, 0, 8), "https://") == 0)
  $tmp_url = "http://" . substr($tmp_url, 8);

before the trailing "?>" of said two lines.

One could shorten this by using preg_replace() but I tend to avoid regexes whenever possible.

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form