From fed5e7b6bb1be35b2bd8e0177cba96292cdba8ee Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Thu, 4 Jun 2015 15:15:32 -0300 Subject: [PATCH] Bug 13967: (RM followup) fix merge error When I merged 13967 into master (with 5010 already on it) I inadvertedly removed a few lines that add a check for bad OPACBaseURL values. While I don't agree with that check it should be discussed on a separate bug anyway. Signed-off-by: Tomas Cohen Arazi --- C4/Context.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/C4/Context.pm b/C4/Context.pm index 188a7ba27e..099ddaf6e6 100644 --- a/C4/Context.pm +++ b/C4/Context.pm @@ -604,6 +604,11 @@ sub set_preference { $value = 0 if ( $type && $type eq 'YesNo' && $value eq '' ); + # force explicit protocol on OPACBaseURL + if ($var eq 'opacbaseurl' && substr($value,0,4) !~ /http/) { + $value = 'http://' . $value; + } + if ($syspref) { $syspref = $syspref->set( { value => $value } )->store(); } -- 2.39.5