#2687 Error in printer friendly URL for month display

open
Craig Knudsen
5
2013-10-10
2012-08-08
James Tate
No

When I click on the printer friendly link from the month view I get the following URL. This only displays the current month, in this case Aug (08).
http://www.inquirysupport.com/WebCalendar/month.php?year=2012&month=09&friendly=1

By removing the "amp;" before "month" from the URL leaving the following then the correct printer friendly calendar is displayed.
http://www.inquirysupport.com/WebCalendar/month.php?year=2012&month=09&friendly=1

Here is the information from the Report Bug page:
System Settings

PROGRAM_NAME: WebCalendar v1.2.5 (29 Feb 2012)
SERVER_SOFTWARE: Apache
Web Browser: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.60 Safari/537.1
PHP Version: 5.2.17
Default Encoding:
db_type: mysql
readonly: N
single_user: Y
single_user_login: is
use_http_auth: N
user_inc: user.php
ADD_LINK_IN_VIEWS: Y
ADMIN_OVERRIDE_UAC: Y
ALLOW_ATTACH: N
ALLOW_ATTACH_ANY: N
ALLOW_ATTACH_PART: N
ALLOW_COLOR_CUSTOMIZATION: Y
ALLOW_COMMENTS: N
ALLOW_COMMENTS_ANY: N
ALLOW_COMMENTS_PART: N
ALLOW_CONFLICTS: N
ALLOW_CONFLICT_OVERRIDE: Y
ALLOW_EXTERNAL_HEADER: N
ALLOW_EXTERNAL_USERS: N
ALLOW_HTML_DESCRIPTION: N
ALLOW_SELF_REGISTRATION: N
ALLOW_USER_HEADER: N
ALLOW_USER_THEMES: Y
ALLOW_VIEW_OTHER: Y
APPLICATION_NAME: Inquiry Support Calendar at BlueHost
APPROVE_ASSISTANT_EVENT: Y
AUTO_REFRESH: N
AUTO_REFRESH_TIME: 0
BGCOLOR: #FFFFFF
BGIMAGE:
BGREPEAT: repeat fixed center
BOLD_DAYS_IN_YEAR: Y
CAPTIONS: #B04040
CATEGORIES_ENABLED: N
CELLBG: #C0C0C0
CONFLICT_REPEAT_MONTHS: 6
CUSTOM_HEADER: Y
CUSTOM_SCRIPT: N
CUSTOM_TRAILER: Y
DATE_FORMAT: __month__ __dd__, __yyyy__
DATE_FORMAT_MD: __month__ __dd__
DATE_FORMAT_MY: __month__ __yyyy__
DATE_FORMAT_TASK: LANGUAGE_DEFINED
DEMO_MODE: N
DISABLE_ACCESS_FIELD: N
DISABLE_CROSSDAY_EVENTS: N
DISABLE_LOCATION_FIELD: N
DISABLE_PARTICIPANTS_FIELD: N
DISABLE_POPUPS: N
DISABLE_PRIORITY_FIELD: N
DISABLE_REMINDER_FIELD: N
DISABLE_REPEATING_FIELD: N
DISABLE_URL_FIELD: Y
DISPLAY_ALL_DAYS_IN_MONTH: N
DISPLAY_CREATED_BYPROXY: Y
DISPLAY_DESC_PRINT_DAY: N
DISPLAY_END_TIMES: N
DISPLAY_LOCATION: N
DISPLAY_LONG_DAYS: N
DISPLAY_LONG_WEEKDAYS: N
DISPLAY_MINUTES: N
DISPLAY_MOON_PHASES: N
DISPLAY_SM_MONTH: Y
DISPLAY_TASKS: N
DISPLAY_TASKS_IN_GRID: N
DISPLAY_UNAPPROVED: Y
DISPLAY_WEEKENDS: Y
DISPLAY_WEEKNUMBER: Y
EMAIL_ASSISTANT_EVENTS: Y
EMAIL_EVENT_ADDED: Y
EMAIL_EVENT_CREATE: N
EMAIL_EVENT_DELETED: Y
EMAIL_EVENT_REJECTED: Y
EMAIL_EVENT_UPDATED: Y
EMAIL_FALLBACK_FROM: youremailhere
EMAIL_HTML: N
EMAIL_MAILER: mail
EMAIL_REMINDER: Y
ENABLE_CAPTCHA: N
ENABLE_GRADIENTS: N
ENABLE_ICON_UPLOADS: N
ENTRY_SLOTS: 144
EXTERNAL_NOTIFICATIONS: N
EXTERNAL_REMINDERS: N
FONTS: Arial, Helvetica, sans-serif
FREEBUSY_ENABLED: N
GENERAL_USE_GMT: Y
GROUPS_ENABLED: Y
H2COLOR: #000000
HASEVENTSBG: #C0C0C0
IMPORT_CATEGORIES: Y
LANGUAGE: English-US
LIMIT_APPTS: N
LIMIT_APPTS_NUMBER: 6
LIMIT_DESCRIPTION_SIZE: N
MENU_DATE_TOP: Y
MENU_ENABLED: N
MENU_THEME: default
MYEVENTS: #006000
NONUSER_AT_TOP: Y
NONUSER_ENABLED: Y
OTHERMONTHBG: #D0D0D0
OVERRIDE_PUBLIC: Y
OVERRIDE_PUBLIC_TEXT: Not available
PARTICIPANTS_IN_POPUP: N
PLUGINS_ENABLED: N
POPUP_BG: #FFFFFF
POPUP_FG: #000000
PUBLIC_ACCESS: Y
PUBLIC_ACCESS_ADD_NEEDS_APPROVAL: Y
PUBLIC_ACCESS_CAN_ADD: Y
PUBLIC_ACCESS_DEFAULT_SELECTED: Y
PUBLIC_ACCESS_DEFAULT_VISIBLE: Y
PUBLIC_ACCESS_OTHERS: Y
PUBLIC_ACCESS_VIEW_PART: Y
PUBLISH_ENABLED: N
PULLDOWN_WEEKNUMBER: N
REMEMBER_LAST_LOGIN: N
REMINDER_DEFAULT: N
REMINDER_OFFSET: 240
REMINDER_WITH_DATE: N
REMOTES_ENABLED: N
REPORTS_ENABLED: Y
REQUIRE_APPROVALS: N
RSS_ENABLED: N
SELF_REGISTRATION_BLACKLIST: N
SELF_REGISTRATION_FULL: Y
SEND_EMAIL: N
SERVER_TIMEZONE: America/New_York
SERVER_URL: http://www.inquirysupport.com/WebCalendar/
SITE_EXTRAS_IN_POPUP: Y
SMTP_AUTH: N
SMTP_HOST: localhost
SMTP_PASSWORD:
SMTP_PORT: 25
SMTP_USERNAME:
STARTVIEW: month.php
SUMMARY_LENGTH: 80
TABLEBG: #000000
TEXTCOLOR: #000000
THBG: #FFFFFF
THEME: none
THFG: #000000
TIMED_EVT_LEN: D
TIMEZONE: America/New_York
TIME_FORMAT: 12
TIME_SLOTS: 24
TIME_SPACER: »
TODAYCELLBG: #FFFF33
UAC_ENABLED: Y
UPCOMING_ALLOW_OVR: N
UPCOMING_DISPLAY_CAT_ICONS: Y
UPCOMING_DISPLAY_LAYERS: N
UPCOMING_DISPLAY_LINKS: Y
UPCOMING_DISPLAY_POPUPS: Y
UPCOMING_EVENTS: N
USER_PUBLISH_ENABLED: Y
USER_PUBLISH_RW_ENABLED: Y
USER_RSS_ENABLED: N
USER_SEES_ONLY_HIS_GROUPS: N
USER_SORT_ORDER: cal_lastname, cal_firstname
WEBCAL_PROGRAM_VERSION: v1.2.5
WEBCAL_TZ_CONVERSION: Y
WEEKENDBG: #D0D0D0
WEEKEND_START: 6
WEEKNUMBER: #FF6633
WEEK_START: 0
WORK_DAY_END_HOUR: 17
WORK_DAY_START_HOUR: 8

Discussion

  • Tom von Alten
    Tom von Alten
    2012-10-23

    I see this bug also. It does NOT occur for a one-argument query string. month.php?date=20121101 is modified by appending &friendly=1 and all is well. month.php?year=2012&month=11 (with the querystring properly URL-encoded as year=2012&month=11) is miscoded to &.

    generate_printer_friendly (in functions.php) uses str_replace to do this, apparently acting on an URL that has been URL-encoded already. Quick hack to fix is to make a second call to str_replace:

    // but don't over do it
    $href = str_replace ( '&', '&', $href );

     
  • DSJones
    DSJones
    2013-10-10

    Still not fixed in @version $Id: functions.php,v 1.520.2.52 2012/03/10 01:09:15 cknudsen Exp $

    diff --git a/includes/functions.php b/includes/functions.php
    index 5fd6ad9..23c7e95 100644
    --- a/includes/functions.php
    +++ b/includes/functions.php
    @@ -1887,6 +1887,7 @@ function generate_printer_friendly ( $hrefin = '' ) {
    // Set this to enable printer icon in top menu.
    $href = ( empty ( $href ) ? $SCRIPT : $hrefin ) . '?'
    . ( empty ( $_SERVER['QUERY_STRING'] ) ? '' : addslashes(htmlentities($_SERVER['QUERY_STRING'])) );
    + $href = str_replace ( '&month', '&month', $href ); // fix path to current month if selected using link above mini calendar
    $href .= ( substr ( $href, -1 ) == '?' ? '' : '&' ) . 'friendly=1';
    $show_printer = true;
    if ( empty ( $hrefin ) ) // Menu will call this function without parameter.