Repository navigation
5.0.0 Release Candidate 2 - #521
Merged
Merged
Conversation
The query compared task_end_date with '0000-00-00 00:00:00'. MySQL in strict mode (NO_ZERO_DATE) rejects that literal, so the task gantt logged "Incorrect DATETIME value" and the to-do gantt lost its start date. task_end_date is nullable, and 022_pre_v2.0_fixes.sql already replaced the stored zero dates, so the IS NOT NULL check is enough. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MkY7nyEKEXcFJj3KYpd7i9
setAllowedSQL() adds "task_id NOT IN (...)" for tasks the user is denied. Both gantt task queries join user_tasks (and the to-do query also joins user_task_pin), which have their own task_id column, so MySQL rejected the query as ambiguous for any user with a denied task. The gantt then drew no tasks. Pass t.task_id as the index in __extract_from_tasks_gantt2() (task gantt) and __extract_from_tasks_gantt1() (to-do gantt). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MkY7nyEKEXcFJj3KYpd7i9
showgtask() now appends to the global $gantt_arr as a flat list of array(task, level), but this view still read it keyed by project id. It also assigned showgtask()'s (void) return value to $gantt_arr, which emptied the list for every top-level task. On PHP 7 this only warned and the "show all tasks" option drew no tasks. On PHP 8 count(null) is a fatal TypeError, so the chart image failed. count($p['tasks']) had the same problem for any sub-project without tasks. Build the flat list once, without assigning showgtask()'s return value, and skip projects that have no tasks. When drawing each project, take the entries whose task_project matches it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MkY7nyEKEXcFJj3KYpd7i9
$advance (the indent for a task's level) was set only for normal tasks, but the milestone branch uses it as well. A milestone drawn before any normal task raised "Undefined variable $advance", and a later milestone used the previous task's indent instead of its own. Set it before the branch. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MkY7nyEKEXcFJj3KYpd7i9
utf8_decode() is deprecated as of PHP 8.2. Truncate the project name with mb_strlen()/mb_substr() and convert it to Latin-1 with mb_convert_encoding(). The output is byte-for-byte the same as before, checked against Latin-1, Cyrillic, Japanese and emoji names. Characters outside Latin-1 still become "?", because the chart uses JpGraph's built-in bitmap fonts. Fixing that needs a TTF font. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MkY7nyEKEXcFJj3KYpd7i9
The chart's date range comes from the start_date/end_date parameters, which default to the earliest task start and latest task end. Two blocks after that had no effect: - The "critical tasks" block recalculated $start_min/$end_max from the project dates and getCriticalTasks()/getCriticalTasksInverted(), but it ran after those values had already been copied into $start_date/$end_date and nothing read them again. It has been in this order since the first commit. Removing it also drops three queries per chart. - The empty start/end fallback scanned $gantt_arr before it was built, so it never found a task, and it called PEAR's Date::compare(). Fall back to the task range instead. Ranges shown today are unchanged. getCriticalTasksInverted() has no callers left. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MkY7nyEKEXcFJj3KYpd7i9
The comment still described $gantt_arr as keyed by project id. It has been a flat list of array(task, level) since showgtask() stopped taking a project id, and that mismatch is what led to the sub-projects gantt fatal fixed in 2537df5. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MkY7nyEKEXcFJj3KYpd7i9
Every chart label used JpGraph's built-in bitmap font (FF_FONT0), which only covers Latin-1, while task and project names are UTF-8. Accented Latin, Cyrillic, Greek and symbols came out as runs of garbage characters. The TTF branches checked for FreeSans in TTF_DIR, which is the system font folder and never lib/fonts, and they also passed FF_FONT0, so a TTF font was never used. JpGraph ships DejaVu Sans in its own fonts folder (as does mitoteam/jpgraph on dev-6.0.0) and checks there first, and its TTF path takes UTF-8. GanttRenderer::font() returns FF_DV_SANSSERIF, or FF_FONT0 when GD has no FreeType. All title, column, bar, caption, milestone, header and "Today" text now uses it. Sizes are chosen to keep the existing layout. The sub-projects gantt no longer converts project names to Latin-1. CJK text still shows as boxes; DejaVu has no CJK glyphs. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MkY7nyEKEXcFJj3KYpd7i9
Both project designer gantt images (the Gantt tab and the task view) asked tasks/gantt.php for "proFilter=&showInactive=1showAllGantt=1", with the & missing before showAllGantt. tasks/gantt.php reads none of those parameters, so the missing & made no difference. Its task filter is f=, and with no f= it falls through to "tasks assigned to me", so the designer's chart left out everyone else's tasks. Ask for f=all instead, which is what showAllGantt=1 intended. Permissions still apply through setAllowedSQL(). The demo screenshot script no longer has to fix the separator. It still adds f=all, but only for tasks/viewgantt.php, which has the same missing filter. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MkY7nyEKEXcFJj3KYpd7i9
cal_work_day_conv() ran the translated day name through utf8_encode(). The locale files are UTF-8, so non-ASCII names were encoded twice: the working-days line in the task dates tab showed Swedish "Lö" as "Lö" and the Russian, Czech and Polish names as mojibake. utf8_encode() is also deprecated as of PHP 8.2. Use the translation as it is. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MkY7nyEKEXcFJj3KYpd7i9
$encoding was only set when mbstring was loaded, but it was used whenever iconv was. Without mbstring the function either passed an undefined $encoding to mb_convert_encoding() (fatal: the function itself comes from mbstring) or, without iconv as well, fell back to utf8_decode(), which converts the other way (UTF-8 to Latin-1) and is deprecated as of PHP 8.2. Use mbstring when it is there and return the text unchanged otherwise. With mbstring the output is the same as before, checked on ASCII, UTF-8, Latin-1, invalid UTF-8 and empty input. The function has no callers in core. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MkY7nyEKEXcFJj3KYpd7i9
The task gantt was its only caller, and d1773ef removed that call. Keep the function for add-on modules that may still use it, but mark it @deprecated and raise an E_USER_NOTICE, as w2p_Database_Query does for its deprecated methods, so any remaining callers show up in the logs. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MkY7nyEKEXcFJj3KYpd7i9
tasks/viewgantt.php built the chart image URL without f=, so tasks/gantt.php fell through to "tasks assigned to me" and the project's Gantt tab left out everyone else's work. Ask for f=all, as the project's Tasks tab does ($f = 'all' in projects/view.php). The to-do gantt (caller=todo) uses its own query and ignores f. Permissions still apply. The demo screenshot script no longer needs to rewrite gantt image URLs, so gantt_all_tasks() becomes gantt_loaded(), which waits for the images to finish loading. This also fixes a hang from a6dede1: once a project designer URL already had f=all, the old helper left its src unchanged and then waited for an onload that never fired. Drop the README note about the bug. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MkY7nyEKEXcFJj3KYpd7i9
Nothing in core calls it. Keep it for add-on modules, but mark it @deprecated and raise an E_USER_NOTICE, as with getCriticalTasksInverted(), so any remaining callers show up in the logs. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MkY7nyEKEXcFJj3KYpd7i9
Header rows. setDateRange() picked the header rows from the number of days alone, so up to 90 days always showed one number per day. At a normal chart width that is 5-6px per day for an 11px label, and the numbers ran together. render() now measures the day width the way GanttGraph::Stroke() does (plot area minus the task table) and shows the most detailed rows whose labels fit: days at 14px+, weeks at 3.2px+ per day, months at 0.8px+, years otherwise. The day-count limits still apply. When no range is set (the sub-projects gantt), the range comes from GanttGraph::GetBarMinMax(), the same range JpGraph autoscales to, instead of always showing all four rows. The header fonts are set in the constructor, so that chart now also uses DejaVu Sans for them. CJK text. DejaVu Sans has no Chinese, Japanese or Korean glyphs. A CJK font is about 20 MB, so web2project doesn't bundle one. Instead it uses $w2Pconfig['gantt_cjk_font'] (documented in config-dist.php), or else the first common system font that exists (Noto Sans CJK, WenQuanYi, Hiragino, Microsoft YaHei). font($text) returns it for text that contains Han, kana or Hangul; all other text stays in DejaVu. JpGraph's TTF loader only looks in its own fonts folder and TTF_DIR, so the renderer gives the image a TTF subclass that also returns that full path for FF_USERFONT. mitoteam/jpgraph on dev-6.0.0 has the same TTF class and public $img->ttf. Each piece of text is drawn in one font, so a row that mixes CJK with Greek or accented letters can lose the glyphs the CJK font lacks. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MkY7nyEKEXcFJj3KYpd7i9
Mixed scripts. A label was drawn in one font: DejaVu Sans, or the CJK font if it had any CJK characters. Labels that mix the two, such as "Ελληνικό έργο / 日本語" or "Wrap-up (山田 / Müller)", lost the glyphs the chosen font lacks (accented Greek in Noto Sans CJK). JpGraph accepts an object with GetWidth()/Stroke() in place of a string in a row's columns and in a caption array. The new w2p_Output_GanttText splits a label into CJK and non-CJK runs and draws each in its own font on one shared baseline, following the label's alignment and restoring it afterwards. GanttRenderer::text() builds these for bar and milestone titles and bar captions. The chart title is a JpGraph Text, which can't hold one, so a title with CJK is still drawn wholly in the CJK font. CJK size. CJK runs are drawn one point larger than the DejaVu runs (the title 12pt instead of 11pt). At the same size, Noto Sans CJK looked smaller and lighter than the rest of the row. Captions. A caption on a bar or milestone near the end of the range was cut off at the image edge. render() now does the range steps GanttGraph::Stroke() would do first (fit the range to the bars when none was set, then extend it to whole weeks; both are safe to repeat), so it measures the chart that gets drawn. fitCaptions() then widens the right margin by the furthest caption overflow, using GanttBar's and MileStone's caption offsets and skipping bars cut at the range end, which get no caption. The extra margin is capped at a third of the plot, so a very narrow chart can still cut a long caption. The header rows are picked again afterwards, since a wider margin narrows the days. setHeaders() switches the year and month grids off first, so the second call doesn't keep grids from the first. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MkY7nyEKEXcFJj3KYpd7i9
b5d9e10 (2012) placed the line at yesterday 12:00, and GanttVLine adds half a day, so it landed at midnight at the start of today. f1f72ab (2014) kept the "minus one day" but switched to the current time, so the line drifted with the clock: at 1 a.m. it was in the middle of yesterday, and only at noon did it reach the start of today. Use today's date in the user's time zone at 00:00. GanttVLine's default half-day offset then puts the line in the middle of today's column at any hour. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MkY7nyEKEXcFJj3KYpd7i9
Task bars were added with the project's $progress and project_id, so every task's progress bar showed the project's % complete. Pass the task's task_percent_complete and task_id, as projects/gantt.php does. The id is what addDependencies() looks up. This chart never loads a task array (only tasks/gantt.php calls loadTaskArray()), so it draws no dependency arrows either way, but the lookup now uses the right task. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MkY7nyEKEXcFJj3KYpd7i9
… charts Dependency arrows. addDependencies() ran one query per bar and matched the results against the list from loadTaskArray(), using its index as the row. Only tasks/gantt.php called loadTaskArray(), so the projects gantt and the sub-projects gantt drew no arrows. That index matching couldn't work there anyway, because project and assignee rows sit between the task rows. addBar()'s last argument also meant three different things: a task id, a project id (project bars) or the task's id again (assignee rows). The renderer now records the row of each bar or milestone given a task id (the first one per task) and, in render(), runs one query for the dependencies between the tasks on the chart, then adds an end-to-start arrow for each. The callers now pass a task id only for task rows: project bars and assignee rows pass none, and milestones pass their task id on all three charts (before, milestones never had arrows). loadTaskArray() is kept as a deprecated no-op. Narrow charts. The task table kept every column at its minimum width, so at about 600px it left about 150px for the bars. render() now keeps the table to half the image: it drops columns from the right first (the bars show the dates), keeping the first column, then shortens the first column's labels with "…" and lets them set that column's width. Wide charts are unchanged; at 1300px the table is about a third. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MkY7nyEKEXcFJj3KYpd7i9
SendQueuedMail() restored the stored properties, including defer, so Send() queued the message again and the queue never emptied. The stored copy also had no recipients, because PHPMailer keeps its address lists private and get_object_vars() can't see them, and it read the undefined $this->transport. The class now keeps its own copy of the recipients it hands to PHPMailer and adds them again before a queued send, with defer turned off. Cc() and Bcc() had the is_array() test backwards, so a string address was never added (and an array went to explode()). Bcc() added its addresses as Cc, so blind copies were visible to everyone. Fixes #424 Fixes #425 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RLxRdA5xvJrPuKCXfcPTEM
hook_cron() assigned load()'s boolean result to $myContact and called store() on it, a fatal Error that ended queuescanner.php before the cron hooks of the modules after Contacts ran. The cron also runs as no user, so load() and store() fail their permission checks anyway. The display name is now set with a direct UPDATE (first + last name, or the e-mail address if both are empty). HookHandler catches Throwable, so an Error in one module's hook no longer stops the rest. Fixes #399 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RLxRdA5xvJrPuKCXfcPTEM
%I is strftime's two-digit 12-hour clock, but format() mapped it to
date('g'), which has no leading zero, so times showed as 1:03 am.
CAppUITest::testFormatTZAwareTimeWithFormat compares against date('h')
and so failed whenever the current hour was 1-9.
Fixes #426
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RLxRdA5xvJrPuKCXfcPTEM
post_message.php formatted the original post's date with $df and $tf, which it never set (two warnings on every reply page). The "original message" block and the "Re:" subject also read from $message, the new empty message, so a reply showed the current user, no date and an empty subject. They now use $last_message (the parent), escaped. Fixes #429 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RLxRdA5xvJrPuKCXfcPTEM
The form echoed $field_name, $field_description, $field_htmltype, $field_extratags, $field_order and $field_published, which were only set when editing, so "add custom field" logged seven warnings. They now start with defaults. The text values are also escaped in the form. Fixes #428 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RLxRdA5xvJrPuKCXfcPTEM
contact_country can hold text that isn't a country code (vCard imports store e.g. USA), and the list looked it up in $countries unchecked. Fixes #430 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RLxRdA5xvJrPuKCXfcPTEM
The page read the background of #td_sample on load, an element that no longer exists, so getComputedStyle(null) threw on every visit and original_bgc stayed undefined. original_bgc is now '' (clearing the inline background restores the stylesheet colour), and getStyle() returns '' for a missing element. Fixes #431 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RLxRdA5xvJrPuKCXfcPTEM
delIt() had a second confirm() that posted do_folder_aed to the Companies module and redirected there, so the user was asked twice and cancelling the first prompt still offered a delete in the wrong module. Fixes #432 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RLxRdA5xvJrPuKCXfcPTEM
When a save fails, controllers keep the object with holdObject() and the edit page gets it back with restoreObject(). The object came back with the query of the request that stored it, whose connection is closed, so the first query it ran was a fatal "mysqli object is already closed" Error (seen on the folder edit page after a rejected save). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RLxRdA5xvJrPuKCXfcPTEM
do_file_aed.php set file_project and file_folder to 0 on the copy, and w2p_FileSystem_Local::duplicate() copied the bytes into files/0/, so a copy of a project file showed up in no project and no folder. The copy now keeps the original's project, task and folder, and the bytes are copied within the project's directory. Nothing in the UI posts duplicate=1 at the moment, so this is only reachable through a hand-made request. Fixes #411 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RLxRdA5xvJrPuKCXfcPTEM
addedit.php built the folder list but the form never rendered it, so "add new file to this folder" saved the file to Root and a file could not be moved to another folder. The form now has a Folder select that defaults to ?folder= for a new file and to the file's folder when editing. Also on this page: an unknown file_id is reported as invalid instead of showing an empty form (load()'s result was not checked), a restored object no longer reads the undefined $file, and the missing referrer, $msg, $ci and $str_out no longer raise warnings. Fixes #405 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RLxRdA5xvJrPuKCXfcPTEM
ListTable::startTable() now takes the id first. vw_sub_projects.php still passed 'list subprojects' as its only argument, so the table got id="list subprojects" and lost its classes. It now gets the id projects-subprojects_view (like the other lists) and the classes it had in 4.0.2. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RLxRdA5xvJrPuKCXfcPTEM
MIN_PHP_VERSION said 8.0.0 while the README requires PHP 8.3.0+. The installer, the dotProject conversion and the System Admin upgrade page all check against it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RLxRdA5xvJrPuKCXfcPTEM
The start and end rows hold a date field, the calendar button and a time select. In the add/edit layout every field takes at least 14rem, so the time select always wrapped onto a full-width line of its own under the date. The three controls now sit in a .w2p-datetime group that keeps them on one line: the date field takes the free space and the time select its natural width. The rule is generic, so other date + time rows can use it. Checked at 1400px, 900px and 390px wide, and saving an event still stores the chosen start and end times. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RLxRdA5xvJrPuKCXfcPTEM
The Dates tab had three controls for each time (hour, minute and a read-only am/pm box), and in the add/edit layout they wrapped onto two extra lines under the date. - Start and finish times are now one select each (start_time, end_time), like the event form: the working day's hours (cal_day_start to cal_day_end) in cal_day_increment steps, the same choices as before, labelled in the user's time format. The date, calendar button and time share a .w2p-datetime row. - A saved task's own time is always offered, so opening and saving a task with an off-grid time (07:10, say) no longer moves it to the first hour in the list. A new task whose default time isn't listed starts at the start of the working day and finishes at its end. - addedit.js reads and sets the times through getTaskTime() and setTaskTime() (which adds a calculated time that isn't listed). The saved task_start_date/task_end_date values are unchanged (YYYYMMDDHHMM), so do_task_aed.php needs no change. setAMPM() is gone. Checked in Chromium at 1400px, 900px and 390px: Calculate Finish Date (days and hours) and Calculate Duration give the same results as before, saving stores the chosen times, and there are no JavaScript errors. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RLxRdA5xvJrPuKCXfcPTEM
The Recurs row has a select, a two-digit count and the word "times". In the add/edit layout each field takes at least 14rem, so the count and "times" always wrapped onto a full-width line of their own. They now sit in a .w2p-inline-fields group: the select takes the free space, the count field is a fixed 4.5rem and "times" follows it. Checked at 1400px, 900px and 390px wide, and saving still stores the recurrence and its count. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RLxRdA5xvJrPuKCXfcPTEM
CAppUI::redirect() appended the raw session id to every Location header (index.php?...&<session id>), as a "fix to handle cookieless sessions". It never worked for that (PHP needs name=id, not a bare value), but it exposed the session id in browser history, server and proxy logs, and the Referer header sent to external links. The id now travels only in the session cookie. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Xv1szzDkTgYELNfPWqPBy
The session id was kept across login, so an id planted in a victim's browser, or seen before they signed in, kept working once they were logged in (session fixation). The login page reuses the browser's existing id after destroying the session, which made this easy. CAppUI::login() now calls session_regenerate_id(true) after a successful login, before preferences are loaded. It covers index.php and fileviewer.php, which both log in through it. With the database session handler the old row is deleted through Session::destroy(). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Xv1szzDkTgYELNfPWqPBy
w2p_System_Session::start() set only the lifetime and path, so the session cookie was readable from JavaScript, sent on cross-site requests, and sent over plain HTTP even on HTTPS installs. The cookie is now HttpOnly and SameSite=Lax, and Secure whenever the request is HTTPS or W2P_BASE_URL starts with https://. No web2project script reads the session cookie. SameSite=Lax means web2project can no longer be used logged-in inside a cross-site iframe. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Xv1szzDkTgYELNfPWqPBy
sendNewPass() could never find a user on current schemas: it filtered on LOWER(user_email), and users has had no email column since the contact methods refactoring (the address is contacts.contact_email), so the query failed and every request got "Invalid username or email". It also stripped . _ @ and - from the username, so users with logins like jane.doe could not have matched anyway. - Look the email up on the user's contact (con.contact_email), case insensitively, and quote both values with Query::quote() instead of building the SQL by hand. - Accept the same username characters as CAppUI::login(), and reject a blank username or malformed email before querying. - Use the configured page_title in the email subject; $_sitename was undefined. - w2p_Authenticators_Base::createNewPassword() picks its 17 characters with random_int() instead of rand() reseeded from microtime(), which made the emailed password guessable and reseeded the global generator. The reset still replaces the password immediately rather than emailing a confirmation link; the identity spec covers moving to a token-based reset. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Xv1szzDkTgYELNfPWqPBy
The Global Search box posts 'keyword' but the SmartSearch page only read 'keyword1', so submitting it landed on an empty search form. Fall back to 'keyword' when 'keyword1' isn't posted, and fix the page's focus script, which referenced a field that doesn't exist. With the header box working, migration 071 hides SmartSearch's menu entry. Access is unchanged and admins can re-show it under View Modules.
Search terms were concatenated straight into LIKE/REGEXP clauses, so any logged-in user could inject SQL through the search box. Every term now goes through w2p_Database_Query::quote(); LIKE wildcards are escaped and REGEXP terms are preg_quote()d so they match literally. Also removes the preg_replace() 'sanitizing' in index.php, whose result was never used.
The four keyword fields were echoed into value="..." unescaped. strip_tags() doesn't stop a double quote from closing the attribute, so a crafted POST could inject script. Run them through w2PformSafe().
highlight() escaped only some regex metacharacters, so a term containing
'/', '{', '}' or ']' broke the pattern and preg_replace() returned null,
blanking the result line. Use preg_quote() with the '/' delimiter.
Also drops the stripslashes(), a leftover from magic quotes that removed
backslashes the user actually searched for.
'' != $keyword2 > 0 compared '' with the boolean result of $keyword2 > 0, so keyword 2 was ignored whenever it didn't compare greater than 0 (e.g. '0'). Use a strict empty-string check, and the same check for keywords 1, 3 and 4.
loadFooterJS() focused the second text input whenever the user could access SmartSearch, assuming the header search box was always the first. On pages without the header (dialogs, popups) that skipped the page's real first field. Exclude #keyword explicitly instead.
Search results printed field values from the database without escaping, so a task or project name containing markup ran in the browser of anyone whose search matched it. highlight() also substituted one keyword at a time into the growing HTML, so a later keyword could match inside the <span> markup an earlier one added. highlight() now matches all keywords in a single pass over the plain text and escapes the text around and inside each match. The result link's href is escaped too. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_019cYjaDM8kTGDyKYoyqi5py
Splitting a keyword on spaces, commas and semicolons left an empty term
whenever the input started or ended with a separator (" alpha", "beta,").
The empty term became LIKE '%%', which matches every row. Split with
PREG_SPLIT_NO_EMPTY everywhere the keywords are split.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019cYjaDM8kTGDyKYoyqi5py
recode2regexp_utf8(), used by "Ignore special chars", had its accented letters saved in a broken encoding, so the alternatives it generated were mojibake that never matched an accented letter. It also walked the input byte by byte, which split multibyte characters apart. Rewrite it with a table of real UTF-8 variants (a, c, d, e, i, l, n, o, r, s, t, u, y, z), walking the input with mb_str_split(). An accented letter in the keyword now matches its plain form too, and uppercase letters get uppercase alternatives so case-sensitive searches still work. The groups stay plain ( | ) so the pattern still works with MySQL's REGEXP. highlight() now names each keyword's group, since the recoded pattern brings unnamed groups of its own that threw off the group numbering. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_019cYjaDM8kTGDyKYoyqi5py
Posting a keyword as an array (keyword1[]=x) made strip_tags() throw a TypeError on PHP 8, and posting modules as a single value or a nested array made array_flip() fail, so a malformed request crashed the page. Keywords are now read through a small helper that treats anything other than a plain value as empty, and the module list keeps only string names. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_019cYjaDM8kTGDyKYoyqi5py
The results table carries the "list" class, so it inherited the white-space: nowrap that list tables use, and long matches ran off the side of the page instead of wrapping. Set white-space: normal on the results cells in both themes. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_019cYjaDM8kTGDyKYoyqi5py
The advanced-search and module-selection sections were shown and hidden by onclick handlers flipping inline styles, and the page set window.onload to focus the keyword box, overwriting any other onload handler (the theme's autofocus already lands there). "Select all" and "Deselect all" were javascript: links. The sections now follow their checkboxes with a few lines of CSS (:has()), the links are real buttons wired by one small listener, and the rest of the script block is gone. The old script cleared keywords 2-4 when "Advanced search" was unchecked; the server now ignores them while it's off instead. Likewise a module selection only filters results while "Modules selection" is checked - before, a hidden selection kept filtering after unchecking it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_019cYjaDM8kTGDyKYoyqi5py
The month and year views (and every minical and the date picker) drew Saturday and Sunday as the weekend whatever the working-day setting, and ignored holidays. w2p_Output_MonthCalendar now asks isWorkingDay() for each cell, and the year view's key says "Non-working day". - isWorkingDay() looks up whether the holiday module is active once per request instead of running a query per call (about 500 on the year view), and falls back to Mon-Fri when cal_working_days is empty as well as when it is null. - Week view uses isWorkingDay() for each day instead of exploding the raw setting, which marked every day non-working when it was unset and ignored holidays. - Week-link cell: one <a>, shown only when a week function is set (it closed the anchor twice and checked the day function). - Minicals: a non-working day that has tasks or events keeps the non-working marker, drawn as a hatch over the task/event colour. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RKBVj1dfCXhTaSxrReYwmM
w2p_Output_MonthCalendar built today's date with format('%Y%m%d%w'),
but w2p_Utilities_Date::format() has no %w, so it produced e.g.
"20261023w" and never matched a cell: no calendar, minical or date
picker highlighted today. Compare the YYYYMMDD part instead.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RKBVj1dfCXhTaSxrReYwmM
The seven columns started at the requested date while tasks and events were loaded for that date's week (beginOfWeek..endOfWeek), so opening a Wednesday showed Wednesday to Tuesday and the days after Saturday were always empty. Start the columns at the beginning of the week. Step through the days from noon instead of midnight: adding 24 hours to midnight on the day DST ends lands on 23:00 the same day, so on servers in a DST time zone that week showed the Sunday twice and lost the Saturday. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RKBVj1dfCXhTaSxrReYwmM
Non-working days used --bs-tertiary-bg (#eff3ff) and task days --bs-primary-bg-subtle (#e8ebfe), which are nearly the same pale blue, so the calendar key and minicals couldn't be read. Non-working days (month view, minicals, key, week view) now use a neutral grey, --w2p-nonworking, with muted day numbers. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RKBVj1dfCXhTaSxrReYwmM
In the Bootstrap theme, minical days outside the month were filled with --bs-secondary-bg (#eef1fb) and kept blue link numbers, so they looked like task days (#e8ebfe). Give them no fill and faint numbers. Also check the month before the task/event colouring, so a day outside the month is drawn as empty even if the links passed to setEvents() cover it. (No current caller passes such days; each loads links for exactly the month it draws.) Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RKBVj1dfCXhTaSxrReYwmM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
v5.0.0 rc2 Release Notes
Release Date: TBD (rc2; merges dev-5.0.0 into master, covering everything since #422)
Download: the release will be tagged on GitHub once this merges.
Reporting problems: please open an issue at https://github.com/web2project/web2project/issues.
New Features
folders_table.php: stubbed record count and always-false checks #408) (001c3b1)cal_working_daysand holidays (673c5f5); the Bootstrap theme marks them distinctly from task days (5fa0287)Fixes/Bugs Closed
Security
w2PgetParam(): drop the filter that never matched; fix callers that relied on it (Fixes w2PgetParam()'s character filter never matches #403) (e1c1cbf)Gantt
task_idin the task permission filter (91268e3)getStyle('td_sample')error on load (Fixes Project Designer throws a JavaScript error on load (getStyle('td_sample')) #431) (21e646a)Calendars, events and dates
Date::format(): pad%Ito two digits (Fixes w2p_Utilities_Date::format('%I') drops the leading zero (testFormatTZAwareTimeWithFormat fails before 10:00) #426) (7bf5328)Files and folders
Mail, contacts, forums and system
load()/store(), so queuescanner.php no longer crashes (Fixes Contacts cron hook crashes queuescanner.php when a contact has no display name #399) (eef4507)$df/$tfand show the message being replied to (Fixes Forum reply form: undefined $df/$tf when showing the original message #429) (e6e2d70)BaseObject: an object restored from the session gets a new query (f821fcb)SmartSearch
0is no longer dropped (f4fc540); empty search terms are dropped instead of matching everything (7d99b15)Misc Changes/Improvements
getCriticalTasksInverted()(65f461c, 11987a9) andstrUTF8Decode()(5288772, 431fa39)utf8_decode()(5dab511)$gantt_arras it is now in theshowgtask()docblock (67d90c9)75 commits, 145 files changed, 2,405 insertions(+), 1,174 deletions(-). No changes under lib/ or vendor/. Merges cleanly into master.
Open/Known Issues
dosqlhandler; index.php has no module access check #463 Any logged-in user can run any module'sdosqlhandlerCAppUI::isActiveModule()interpolates the module name into SQL and runs a query on every call #457CAppUI::isActiveModule()interpolates the module name into SQL__nonceform token now required on dosql, AJAX anddo_*requests #464 The add-on upgrade guide doesn't yet mention the__nonceform token now required on dosql, AJAX anddo_*requestsw2p_Utilities_Date::format()ignores%: literal letters are replaced and most codes are unsupported #519 /getBeginWeek()/getEndWeek()always see Sunday:Format('%w')returns "w" #520w2p_Utilities_Date::format()ignores%, sogetBeginWeek()/getEndWeek()always see Sundaydo_user_aed.php), so some valid addresses collide (not yet filed)Metrics
Measured with phploc 8.0.4 on dev-5.0.0 (7915002), excluding lib/ and vendor/, the same as the
phploctarget in unit_tests/build.xml.🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01UoVWmtmH7ic11XrcYKLtYe