Where can I find the display code for survey links?

More
4 years 5 months ago - 4 years 5 months ago #91733 by Sirblackadder
Sirblackadder created the topic: Where can I find the display code for survey links?
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,
Malte
Last Edit: 4 years 5 months ago by Sirblackadder.

Please Log in to join the conversation.

More
4 years 5 months ago - 4 years 5 months ago #91836 by Sirblackadder
Sirblackadder replied the topic: Aw: Where can I find the display code for survey links?
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.
Last Edit: 4 years 5 months ago by Sirblackadder.

Please Log in to join the conversation.

Did you already participate in our customer survey?

Don't miss your chance for great prices.

Please click here to participate:

Start now

Start now!

Just create your account and start using Limesurvey today.

Register now